mirror of https://gitee.com/openkylin/linux.git
[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:
parent
82e3b88b67
commit
b036f1cb6e
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue