aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--utils/v4l2-ctl/v4l2-ctl-common.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp
index 4ca1b834..60624750 100644
--- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
@@ -844,11 +844,13 @@ void common_set(int fd)
if (fill_subset(qc, subset))
return;
- divide[qc.nr_of_dims - 1] = 1;
- for (d = 0; d < qc.nr_of_dims - 1; d++) {
- divide[d] = qc.dims[d + 1];
- for (i = 0; i < d; i++)
- divide[i] *= divide[d];
+ if (qc.nr_of_dims) {
+ divide[qc.nr_of_dims - 1] = 1;
+ for (d = 0; d < qc.nr_of_dims - 1; d++) {
+ divide[d] = qc.dims[d + 1];
+ for (i = 0; i < d; i++)
+ divide[i] *= divide[d];
+ }
}

Privacy Policy