diff options
author | Mauro Carvalho Chehab | 2015-04-28 19:39:53 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab | 2015-04-30 14:27:15 -0300 |
commit | b036f1cb6e268f2a8c4433c3c26cbef95642b79d (patch) | |
tree | e1b3cc60d8990e915e10ba57c29a0c23735c1320 /drivers/media/usb | |
parent | 82e3b88b679049f043fe9b03991d6d66fc0a43c8 (diff) |
[media] zc3xx: don't go past quality array
drivers/media/usb/gspca/zc3xx.c:6363 zcxx_s_ctrl() error: buffer overflow 'jpeg_qual' 3 <= 3
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r-- | drivers/media/usb/gspca/zc3xx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/usb/gspca/zc3xx.c b/drivers/media/usb/gspca/zc3xx.c index d3e1b6d8bf49..3762a045f744 100644 --- a/drivers/media/usb/gspca/zc3xx.c +++ b/drivers/media/usb/gspca/zc3xx.c @@ -6360,7 +6360,7 @@ static int zcxx_s_ctrl(struct v4l2_ctrl *ctrl) if (ctrl->val <= jpeg_qual[i]) break; } - if (i > 0 && i == qual && ctrl->val < jpeg_qual[i]) + if (i == ARRAY_SIZE(jpeg_qual) || (i > 0 && i == qual && ctrl->val < jpeg_qual[i])) i--; /* With high quality settings we need max bandwidth */ |