The patch number 14395 was added via Douglas Schilling Landgraf 
<[email protected]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        Linux Media Mailing List <[email protected]>

------

From: Baruch Siach  <[email protected]>
soc_camera: fix bound checking of mbus_fmt[] index


When code <= V4L2_MBUS_FMT_FIXED soc_mbus_get_fmtdesc returns a pointer to
mbus_fmt[x], where x < 0. Fix this.

Priority: normal

Signed-off-by: Baruch Siach <[email protected]>
Signed-off-by: Guennadi Liakhovetski <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Douglas Schilling Landgraf <[email protected]>


---

 linux/drivers/media/video/soc_mediabus.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -r efded04b2da2 -r 599590792ee0 linux/drivers/media/video/soc_mediabus.c
--- a/linux/drivers/media/video/soc_mediabus.c  Sat Mar 06 20:38:31 2010 -0300
+++ b/linux/drivers/media/video/soc_mediabus.c  Sat Mar 06 20:40:38 2010 -0300
@@ -149,7 +149,8 @@
 const struct soc_mbus_pixelfmt *soc_mbus_get_fmtdesc(
        enum v4l2_mbus_pixelcode code)
 {
-       if ((unsigned int)(code - V4L2_MBUS_FMT_FIXED) > ARRAY_SIZE(mbus_fmt))
+       if (code - V4L2_MBUS_FMT_FIXED > ARRAY_SIZE(mbus_fmt) ||
+           code <= V4L2_MBUS_FMT_FIXED)
                return NULL;
        return mbus_fmt + code - V4L2_MBUS_FMT_FIXED - 1;
 }


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/599590792ee00d2e1129c05f449757d139665638

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to