ulpfecenc: slightly safer dispose impl
authorMatthew Waters <matthew@centricular.com>
Mon, 21 Feb 2022 02:27:06 +0000 (13:27 +1100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 21 Feb 2022 09:43:33 +0000 (09:43 +0000)
Technically dispose can be called more than once (even if gstelement is
not actually set up to do that) so need to protect against that.

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

subprojects/gst-plugins-good/gst/rtp/gstrtpulpfecenc.c

index 5928ba9..c95fe0d 100644 (file)
@@ -753,7 +753,9 @@ gst_rtp_ulpfec_enc_dispose (GObject * obj)
 {
   GstRtpUlpFecEnc *fec = GST_RTP_ULPFEC_ENC (obj);
 
-  g_hash_table_destroy (fec->ssrc_to_ctx);
+  if (fec->ssrc_to_ctx)
+    g_hash_table_destroy (fec->ssrc_to_ctx);
+  fec->ssrc_to_ctx = NULL;
 
   G_OBJECT_CLASS (gst_rtp_ulpfec_enc_parent_class)->dispose (obj);
 }