diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-03-02 12:31:24 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2023-04-15 09:54:09 +0200 |
commit | ff6dad2f95fb6a3474fdf3ee9edf6892908302dd (patch) | |
tree | ba8c30a74ab6e63733970af2a81c4f57f9b74428 | |
parent | media: common: saa7146: fix compliance problems with field handling (diff) | |
download | linux-ff6dad2f95fb6a3474fdf3ee9edf6892908302dd.tar.xz linux-ff6dad2f95fb6a3474fdf3ee9edf6892908302dd.zip |
media: common: saa7146: check minimum video format size
There was no check for the minimum width and height, so
0 values were just passed on. Fix this.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
-rw-r--r-- | drivers/media/common/saa7146/saa7146_video.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/common/saa7146/saa7146_video.c b/drivers/media/common/saa7146/saa7146_video.c index 8306860e9e8a..65045f7aa28d 100644 --- a/drivers/media/common/saa7146/saa7146_video.c +++ b/drivers/media/common/saa7146/saa7146_video.c @@ -392,6 +392,10 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *fh, struct v4l2_forma f->fmt.pix.field = field; f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; + if (f->fmt.pix.width < 48) + f->fmt.pix.width = 48; + if (f->fmt.pix.height < 32) + f->fmt.pix.height = 32; if (f->fmt.pix.width > maxw) f->fmt.pix.width = maxw; if (f->fmt.pix.height > maxh) |