mirror of
https://github.com/patjak/facetimehd.git
synced 2026-04-09 19:10:01 +02:00
facetimehd: check index parameter in enum_framesizes()/enum_frameintervals()
otherwise we might have callers trying all possible index value which takes a lot of time.
This commit is contained in:
@@ -533,6 +533,9 @@ static int fthd_v4l2_ioctl_s_parm(struct file *filp, void *priv,
|
|||||||
static int fthd_v4l2_ioctl_enum_framesizes(struct file *filp, void *priv,
|
static int fthd_v4l2_ioctl_enum_framesizes(struct file *filp, void *priv,
|
||||||
struct v4l2_frmsizeenum *sizes)
|
struct v4l2_frmsizeenum *sizes)
|
||||||
{
|
{
|
||||||
|
if (sizes->index)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
sizes->type = V4L2_FRMSIZE_TYPE_CONTINUOUS;
|
sizes->type = V4L2_FRMSIZE_TYPE_CONTINUOUS;
|
||||||
sizes->stepwise.min_width = 320;
|
sizes->stepwise.min_width = 320;
|
||||||
sizes->stepwise.max_width = 2560;
|
sizes->stepwise.max_width = 2560;
|
||||||
@@ -548,6 +551,9 @@ static int fthd_v4l2_ioctl_enum_frameintervals(struct file *filp, void *priv,
|
|||||||
{
|
{
|
||||||
pr_debug("%s\n", __FUNCTION__);
|
pr_debug("%s\n", __FUNCTION__);
|
||||||
|
|
||||||
|
if (interval->index)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
if (interval->pixel_format != V4L2_PIX_FMT_YUYV &&
|
if (interval->pixel_format != V4L2_PIX_FMT_YUYV &&
|
||||||
interval->pixel_format != V4L2_PIX_FMT_YVYU &&
|
interval->pixel_format != V4L2_PIX_FMT_YVYU &&
|
||||||
interval->pixel_format != V4L2_PIX_FMT_NV16)
|
interval->pixel_format != V4L2_PIX_FMT_NV16)
|
||||||
|
|||||||
Reference in New Issue
Block a user