From de2a8bd4ad9ff404a5ffd86ccadef0391710fe33 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Mon, 19 Feb 2024 21:49:21 +0800 Subject: [PATCH] v4l2: silence valgrind warning Valgrind complains about uninitialized memory used in an ioctl Syscall param ioctl(VKI_V4L2_G_TUNER).reserved points to uninitialised byte(s) at 0x719294F: ioctl (ioctl.c:36) by 0x3126A817: gst_v4l2_fill_lists (v4l2_calls.c:185) by 0x3126A817: gst_v4l2_open (v4l2_calls.c:589) by 0x3123F1C2: gst_v4l2_device_provider_probe_device (gstv4l2deviceprovider.c:122) by 0x3123F648: gst_v4l2_device_provider_device_from_udev (gstv4l2deviceprovider.c:301) by 0x3123F998: provider_thread (gstv4l2deviceprovider.c:395) by 0x796FA50: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7200.4) by 0x710CAC2: start_thread (pthread_create.c:442) by 0x719DA03: clone (clone.S:100) Address 0x44008a34 is on thread 11's stack in frame #1, created by gst_v4l2_open (v4l2_calls.c:524) Uninitialised value was created by a stack allocation at 0x3126A024: gst_v4l2_open (v4l2_calls.c:524) Part-of: --- subprojects/gst-plugins-good/sys/v4l2/v4l2_calls.c | 1 + 1 file changed, 1 insertion(+) diff --git a/subprojects/gst-plugins-good/sys/v4l2/v4l2_calls.c b/subprojects/gst-plugins-good/sys/v4l2/v4l2_calls.c index e207c51a3c..b2165bc13b 100644 --- a/subprojects/gst-plugins-good/sys/v4l2/v4l2_calls.c +++ b/subprojects/gst-plugins-good/sys/v4l2/v4l2_calls.c @@ -177,6 +177,7 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object) if (input.type == V4L2_INPUT_TYPE_TUNER) { struct v4l2_tuner vtun; + memset (&vtun, 0, sizeof (vtun)); v4l2channel->tuner = input.tuner; channel->flags |= GST_TUNER_CHANNEL_FREQUENCY;