Commit b036f1cb authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[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: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 82e3b88b
...@@ -6360,7 +6360,7 @@ static int zcxx_s_ctrl(struct v4l2_ctrl *ctrl) ...@@ -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 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment