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

Commit d27d5f1a authored by Helen Fornazier's avatar Helen Fornazier Committed by Mauro Carvalho Chehab
Browse files

[media] stk1160: Check *nplanes in queue_setup



If *nplanes is not zero, it should use the requested size if valid

Signed-off-by: default avatarHelen Koike <helen.koike@collabora.co.uk>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent f4bca74f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -680,6 +680,9 @@ static int queue_setup(struct vb2_queue *vq,
	*nbuffers = clamp_t(unsigned int, *nbuffers,
			STK1160_MIN_VIDEO_BUFFERS, STK1160_MAX_VIDEO_BUFFERS);

	if (*nplanes)
		return sizes[0] < size ? -EINVAL : 0;

	/* This means a packed colorformat */
	*nplanes = 1;