aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-08-04 09:22:50 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2014-08-04 09:22:50 +0200
commit6daaf3258cbaee3046f0411b90299cc325696a83 (patch)
tree90e96f91822eba25e80e39fb0a77e80452762a66
parent929ab3ae0e4ab3ccfee9c10c2f097d6385a51a66 (diff)
libv4l2: valgrind fixes
Initialize reserved fields and a v4l2_format struct. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-rw-r--r--lib/libv4l2/libv4l2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libv4l2/libv4l2.c b/lib/libv4l2/libv4l2.c
index afac4069..fe513d71 100644
--- a/lib/libv4l2/libv4l2.c
+++ b/lib/libv4l2/libv4l2.c
@@ -200,6 +200,7 @@ static int v4l2_map_buffers(int index)
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_MMAP;
buf.index = i;
+ buf.reserved = buf.reserved2 = 0;
result = devices[index].dev_ops->ioctl(
devices[index].dev_ops_priv,
devices[index].fd, VIDIOC_QUERYBUF, &buf);
@@ -588,6 +589,7 @@ static int v4l2_buffers_mapped(int index)
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_MMAP;
buf.index = i;
+ buf.reserved = buf.reserved2 = 0;
if (devices[index].dev_ops->ioctl(
devices[index].dev_ops_priv,
devices[index].fd, VIDIOC_QUERYBUF,
@@ -1242,7 +1244,7 @@ no_capture_request:
case VIDIOC_S_STD:
case VIDIOC_S_INPUT:
case VIDIOC_S_DV_TIMINGS: {
- struct v4l2_format src_fmt;
+ struct v4l2_format src_fmt = { 0 };
result = devices[index].dev_ops->ioctl(
devices[index].dev_ops_priv,

Privacy Policy