summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorRob Taylor <rob.taylor@codethink.co.uk>2015-07-23 09:21:43 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-08-16 13:28:24 -0300
commit4284118058b2b4f217a050908a555d0e1ed58641 (patch)
treeeada541bbef5026249ca5e706b9a2d914fc07ef5 /drivers/media
parent734f3f238587ffb6938700c4495dd5b5a54c4125 (diff)
[media] media: rcar_vin: Reject videobufs that are too small for current format
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>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/soc_camera/rcar_vin.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c
index 6abef82b204f..71dd71c0bd1f 100644
--- a/drivers/media/platform/soc_camera/rcar_vin.c
+++ b/drivers/media/platform/soc_camera/rcar_vin.c
@@ -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)