[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>
This commit is contained in:
Mauro Carvalho Chehab 2015-04-28 19:39:53 -03:00
parent 82e3b88b67
commit b036f1cb6e
1 changed files with 1 additions and 1 deletions

View File

@ -6360,7 +6360,7 @@ static int zcxx_s_ctrl(struct v4l2_ctrl *ctrl)
if (ctrl->val <= jpeg_qual[i]) if (ctrl->val <= jpeg_qual[i])
break; 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--; i--;
/* With high quality settings we need max bandwidth */ /* With high quality settings we need max bandwidth */