]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] media: rcar_vin: Reject videobufs that are too small for current format
authorRob Taylor <rob.taylor@codethink.co.uk>
Thu, 23 Jul 2015 12:21:43 +0000 (09:21 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Sun, 16 Aug 2015 16:28:24 +0000 (13:28 -0300)
In videobuf_setup reject buffers that are too small for the configured
format. Fixes v4l2-compliance issue.

Signed-off-by: Rob Taylor <rob.taylor@codethink.co.uk>
Reviewed-by: William Towle <william.towle@codethink.co.uk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/platform/soc_camera/rcar_vin.c

index 6abef82b204f4b23deac25b51334bb6c452223d1..71dd71c0bd1f79ad933f0bc97c5ae4600f577da1 100644 (file)
@@ -541,6 +541,9 @@ static int rcar_vin_videobuf_setup(struct vb2_queue *vq,
                unsigned int bytes_per_line;
                int ret;
 
+               if (fmt->fmt.pix.sizeimage < icd->sizeimage)
+                       return -EINVAL;
+
                xlate = soc_camera_xlate_by_fourcc(icd,
                                                   fmt->fmt.pix.pixelformat);
                if (!xlate)