oggdemux: Set chain pointers to NULL
authorOlivier CrĂȘte <olivier.crete@collabora.com>
Thu, 30 Jul 2015 20:39:03 +0000 (16:39 -0400)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Thu, 6 Aug 2015 16:40:40 +0000 (17:40 +0100)
Otherwise, they will refer to freed memory

https://bugzilla.gnome.org/show_bug.cgi?id=753078

ext/ogg/gstoggdemux.c

index 3042fcaa9237dfd6894591275512f377acff770a..ee750b25b26cc1cafe554d5d524e375787bf1c7d 100644 (file)
@@ -2777,6 +2777,7 @@ gst_ogg_demux_deactivate_current_chain (GstOggDemux * ogg)
   if (!ogg->pullmode) {
     if (ogg->building_chain == chain)
       ogg->building_chain = NULL;
+    ogg->current_chain = NULL;
     gst_ogg_chain_free (chain);
   }
 
@@ -4920,6 +4921,8 @@ gst_ogg_demux_clear_chains (GstOggDemux * ogg)
     gst_ogg_chain_free (chain);
   }
   ogg->chains = g_array_set_size (ogg->chains, 0);
+  ogg->current_chain = NULL;
+  ogg->building_chain = NULL;
   GST_CHAIN_UNLOCK (ogg);
 }