From 7532c491b784b89a20f7a5f9c30147235f07b6b9 Mon Sep 17 00:00:00 2001 From: Patrik Jakobsson Date: Mon, 30 Nov 2015 21:15:53 +0100 Subject: [PATCH] facetimehd: Only allow framesizes for formats we support --- fthd_v4l2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fthd_v4l2.c b/fthd_v4l2.c index 23ae466..e5294b9 100644 --- a/fthd_v4l2.c +++ b/fthd_v4l2.c @@ -515,6 +515,10 @@ static int fthd_v4l2_ioctl_enum_framesizes(struct file *filp, void *priv, if (sizes->index) return -EINVAL; + if (sizes->pixel_format != V4L2_PIX_FMT_YUYV && + sizes->pixel_format != V4L2_PIX_FMT_YVYU) + return -EINVAL; + sizes->type = V4L2_FRMSIZE_TYPE_STEPWISE; sizes->stepwise.min_width = FTHD_MIN_WIDTH; sizes->stepwise.max_width = FTHD_MAX_WIDTH;