asfdemux: don't leak payload bufs in gst_asf_demux_free_stream
authorAlessandro Decina <alessandro.decina@collabora.com>
Tue, 10 Apr 2012 15:23:24 +0000 (17:23 +0200)
committerNikhil Devshatwar <a0132237@ti.com>
Fri, 17 May 2013 09:40:56 +0000 (15:10 +0530)
gst/asfdemux/gstasfdemux.c

index 743e432a2b42ebc35229b9ba89abe28375a2ce19..46cee6dad5b69695b2f3610fdb363b9c82fc5f93 100644 (file)
@@ -171,6 +171,12 @@ gst_asf_demux_free_stream (GstASFDemux * demux, AsfStream * stream)
     g_array_remove_index (stream->payloads, last);
   }
   if (stream->payloads) {
+    int i;
+    for (i = 0; i < stream->payloads->len; i++) {
+      AsfPayload *payload;
+      payload = &g_array_index (stream->payloads, AsfPayload, i);
+      gst_buffer_replace (&payload->buf, NULL);
+    }
     g_array_free (stream->payloads, TRUE);
     stream->payloads = NULL;
   }