[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>
This commit is contained in:
Rob Taylor 2015-07-23 09:21:43 -03:00 committed by Mauro Carvalho Chehab
parent 734f3f2385
commit 4284118058

View 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)