From: mglocker Date: Sun, 28 Nov 2021 13:57:37 +0000 (+0000) Subject: utvfu(4) only has one frame size, either for PAL or NTSC. Therefore X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=dcbbabc282aa8fc6864b9f0ae78bef0e784b0688;p=openbsd utvfu(4) only has one frame size, either for PAL or NTSC. Therefore return EINVAL after the first frame size has been returned in the VIDIOC_ENUM_FRAMESIZES ioctl. ok mpi@ --- diff --git a/sys/dev/usb/utvfu.c b/sys/dev/usb/utvfu.c index 8f89c308fc2..eb65ff7ae75 100644 --- a/sys/dev/usb/utvfu.c +++ b/sys/dev/usb/utvfu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utvfu.c,v 1.13 2021/11/24 21:57:56 mglocker Exp $ */ +/* $OpenBSD: utvfu.c,v 1.14 2021/11/28 13:57:37 mglocker Exp $ */ /* * Copyright (c) 2013 Lubomir Rintel * Copyright (c) 2013 Federico Simoncelli @@ -537,6 +537,10 @@ utvfu_enum_fsizes(void *v, struct v4l2_frmsizeenum *fsizes) if (fsizes->pixel_format != V4L2_PIX_FMT_YUYV) return (EINVAL); + /* The device only supports one frame size. */ + if (fsizes->index >= 1) + return (EINVAL); + fsizes->type = V4L2_FRMSIZE_TYPE_DISCRETE; fsizes->discrete.width = utvfu_norm_params[sc->sc_normi].cap_width; fsizes->discrete.height = utvfu_norm_params[sc->sc_normi].cap_height;