From 9639f32db5f8c848702fccbbbd7d7a111db64143 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 29 Sep 2020 17:06:53 +0200 Subject: [PATCH] v4l2: zero some structures before ioctl --- spa/plugins/v4l2/v4l2-utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spa/plugins/v4l2/v4l2-utils.c b/spa/plugins/v4l2/v4l2-utils.c index 757b3e0ab..26b54ba9c 100644 --- a/spa/plugins/v4l2/v4l2-utils.c +++ b/spa/plugins/v4l2/v4l2-utils.c @@ -582,6 +582,7 @@ spa_v4l2_enum_format(struct impl *this, int seq, port->fmtdesc.pixelformat = info->fourcc; + spa_zero(fmt); fmt.type = port->fmtdesc.type; fmt.fmt.pix.pixelformat = info->fourcc; fmt.fmt.pix.field = V4L2_FIELD_ANY; @@ -977,6 +978,7 @@ static int query_ext_ctrl_ioctl(struct port *port, struct v4l2_query_ext_ctrl *q return res; port->have_query_ext_ctrl = false; } + spa_zero(qc); qc.id = qctrl->id; res = xioctl(dev->fd, VIDIOC_QUERYCTRL, &qc); if (res == 0) {