flvmux: Add protection when unref GstFlvMuxPad
authorHou Qi <qi.hou@nxp.com>
Thu, 3 Mar 2022 06:22:10 +0000 (14:22 +0800)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 7 Mar 2022 13:03:16 +0000 (13:03 +0000)
This is to avoid gst_object_unref: assertion 'object != NULL' failed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1843>

subprojects/gst-plugins-good/gst/flv/gstflvmux.c

index 6ce6413..cb4db02 100644 (file)
@@ -2080,8 +2080,10 @@ gst_flv_mux_aggregate (GstAggregator * aggregator, gboolean timeout)
       gst_buffer_unref (buffer);
       buffer = NULL;
     }
-    gst_object_unref (best);
-    best = NULL;
+    if (best) {
+      gst_object_unref (best);
+      best = NULL;
+    }
   }
 
   if (best) {