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🔢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>
This commit is contained in:
Sebastian Dröge 2023-05-12 13:12:04 +03:00 committed by GStreamer Marge Bot
parent 186d8a99cc
commit f9a3b3eacf

View file

@ -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);