diff --git a/subprojects/gst-plugins-good/gst/flv/gstflvmux.c b/subprojects/gst-plugins-good/gst/flv/gstflvmux.c index 6ce6413e5b..cb4db020ea 100644 --- a/subprojects/gst-plugins-good/gst/flv/gstflvmux.c +++ b/subprojects/gst-plugins-good/gst/flv/gstflvmux.c @@ -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) {