Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 42841180 authored by Rob Taylor's avatar Rob Taylor Committed by Mauro Carvalho Chehab
Browse files

[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: default avatarRob Taylor <rob.taylor@codethink.co.uk>
Reviewed-by: default avatarWilliam Towle <william.towle@codethink.co.uk>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 734f3f23
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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)