]> git.baikalelectronics.ru Git - kernel.git/commit
[media] V4L: mx2-camera: avoid overflowing 32-bits
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Tue, 8 May 2012 14:46:44 +0000 (11:46 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 15 May 2012 19:14:01 +0000 (16:14 -0300)
commit8bf01d2eca5b9ee29737cc18b1f28015c7c5cb59
tree024321e97d066467df8b25fe92d59b6f2d244b9e
parent9edd37176304332b2510d1aed3501f76da703e28
[media] V4L: mx2-camera: avoid overflowing 32-bits

In mx2_camera_try_fmt(), when applying i.MX25 restrictions to frame sizes,
the height is checked to be <= 0xffff. But later an integer multiplication
height * 4 * 0x3ffff is performed, which will overflow even for bounded
height values. This patch switches to using 64-bit multiplication and
division to avoid overflowing.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/mx2_camera.c