From 4284118058b2b4f217a050908a555d0e1ed58641 Mon Sep 17 00:00:00 2001 From: Rob Taylor Date: Thu, 23 Jul 2015 09:21:43 -0300 Subject: [PATCH] [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 Reviewed-by: William Towle Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/soc_camera/rcar_vin.c | 3 +++ 1 file changed, 3 insertions(+) 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) -- 2.39.5