summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2023-05-12 13:12:04 +0300
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2023-05-14 14:26:05 +0000
commitf9a3b3eacf9eead6a65e51e50b911e70f8496020 (patch)
treef0f8e827748329625dc54ba14856a12b65be108f
parent186d8a99cc67b6da6457f2495cdbc3bc9c9f20b1 (diff)
downloadgstreamer-f9a3b3eacf9eead6a65e51e50b911e70f8496020.tar.gz
rtpjitterbuffer: Fix uninitialized variable compiler warning
It could indeed be used uninitialized, but only if one of the g_return_val_if_fail() caused an early return. ../subprojects/gst-plugins-good/gst/rtpmanager/rtpjitterbuffer.c: In function ‘rtp_jitter_buffer_append_query’: ../subprojects/gst-plugins-good/gst/rtpmanager/rtpjitterbuffer.c:1234:10: warning: ‘head’ may be used uninitialized [-Wmaybe-uninitialized] 1234 | return head; | ^~~~ ../subprojects/gst-plugins-good/gst/rtpmanager/rtpjitterbuffer.c:1232:12: note: ‘head’ was declared here 1232 | gboolean head; | ^~~~ Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4616>
-rw-r--r--subprojects/gst-plugins-good/gst/rtpmanager/rtpjitterbuffer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/subprojects/gst-plugins-good/gst/rtpmanager/rtpjitterbuffer.c b/subprojects/gst-plugins-good/gst/rtpmanager/rtpjitterbuffer.c
index c709769710..873fcbe364 100644
--- a/subprojects/gst-plugins-good/gst/rtpmanager/rtpjitterbuffer.c
+++ b/subprojects/gst-plugins-good/gst/rtpmanager/rtpjitterbuffer.c
@@ -1075,6 +1075,11 @@ rtp_jitter_buffer_insert (RTPJitterBuffer * jbuf, RTPJitterBufferItem * item,
GList *list, *event = NULL;
guint16 seqnum;
+ if (G_LIKELY (head))
+ *head = FALSE;
+ if (percent)
+ *percent = -1;
+
g_return_val_if_fail (jbuf != NULL, FALSE);
g_return_val_if_fail (item != NULL, FALSE);