rtpbasedepay: fix locking of GstRTPHeaderExtension
authorJakub Adam <jakub.adam@collabora.com>
Wed, 21 Apr 2021 15:18:51 +0000 (17:18 +0200)
committerJakub Adam <jakub.adam@collabora.com>
Wed, 21 Apr 2021 15:34:18 +0000 (17:34 +0200)
'ext' object unlocked if gst_rtp_header_extension_read() fails was never
locked in the first place.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1118>

gst-libs/gst/rtp/gstrtpbasedepayload.c

index b1e12d9c10e0b0d063e1688a68cf82c6465149fa..c2645fbf8f0a2253d7f1ff1ea18956d5ab859645 100644 (file)
@@ -1233,6 +1233,7 @@ read_rtp_header_extensions (GstRTPBaseDepayload * depayload,
       }
 
       if (ext) {
+        GST_OBJECT_LOCK (ext);
         if (!gst_rtp_header_extension_read (ext, ext_flags, &pdata[offset],
                 read_len, output)) {
           GST_WARNING_OBJECT (depayload, "RTP header extension (%s) could "
@@ -1246,6 +1247,7 @@ read_rtp_header_extensions (GstRTPBaseDepayload * depayload,
           needs_src_caps_update = TRUE;
         }
 
+        GST_OBJECT_UNLOCK (ext);
         gst_object_unref (ext);
       }
       GST_OBJECT_UNLOCK (depayload);