media: ov7740: avoid invalid framesize setting
authorAkinobu Mita <akinobu.mita@gmail.com>
Wed, 17 Apr 2019 14:06:39 +0000 (10:06 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 23 May 2019 09:39:38 +0000 (05:39 -0400)
commit6e4ab830ac6d6a0d7cd7f87dc5d6536369bf24a8
treefaa6134ef8851aabc42d525995f28d82ac905557
parentcfe7cc383cfadff6d3596296c86d7ab7487fc6f4
media: ov7740: avoid invalid framesize setting

If the requested framesize by VIDIOC_SUBDEV_S_FMT is larger than supported
framesizes, it causes an out of bounds array access and the resulting
framesize is unexpected.

Avoid out of bounds array access and select the default framesize.

Cc: Wenyou Yang <wenyou.yang@microchip.com>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/i2c/ov7740.c