gst/avi/gstavidemux.c: You need to allocatate (len+1) characters to store a len size...
authorEdward Hervey <bilboed@bilboed.com>
Thu, 4 Aug 2005 18:31:12 +0000 (18:31 +0000)
committerEdward Hervey <bilboed@bilboed.com>
Thu, 4 Aug 2005 18:31:12 +0000 (18:31 +0000)
Original commit message from CVS:
* gst/avi/gstavidemux.c: (gst_avi_demux_reset),
(gst_avi_demux_parse_stream), (gst_avi_demux_process_next_entry):
You need to allocatate (len+1) characters to store a len size string.
Also don't stop the processing task if the output pad is not linked.

ChangeLog
gst/avi/gstavidemux.c

index 75c5df2462c89c2dbf4b18d41c599e803e8c2873..fa8196d4179f3fec04f419bd431367e7153ca00e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-08-04  Edward Hervey  <edward@fluendo.com>
+
+       * gst/avi/gstavidemux.c: (gst_avi_demux_reset),
+       (gst_avi_demux_parse_stream), (gst_avi_demux_process_next_entry):
+       You need to allocatate (len+1) characters to store a len size string.
+       Also don't stop the processing task if the output pad is not linked.
+
 2005-08-03  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
 
        * ext/gconf/gstgconfaudiosink.c: (gst_gconf_audio_sink_reset),
index 3e6a4836fb104a03ee7b2ea38ae43ed1f2452f14..248ed869d7c5ce19b72aafafa763032c14e9a219 100644 (file)
@@ -162,7 +162,8 @@ gst_avi_demux_reset (GstAviDemux * avi)
   for (i = 0; i < avi->num_streams; i++) {
     g_free (avi->stream[i].strh);
     g_free (avi->stream[i].strf.data);
-    g_free (avi->stream[i].name);
+    if (avi->stream[i].name)
+      g_free (avi->stream[i].name);
     if (avi->stream[i].initdata)
       gst_buffer_unref (avi->stream[i].initdata);
     if (avi->stream[i].extradata)
@@ -963,7 +964,7 @@ gst_avi_demux_parse_stream (GstElement * element, GstBuffer * buf)
         break;
       case GST_RIFF_TAG_strn:
         g_free (stream->name);
-        stream->name = g_new (gchar, GST_BUFFER_SIZE (sub));
+        stream->name = g_new (gchar, GST_BUFFER_SIZE (sub) + 1);
         memcpy (stream->name, GST_BUFFER_DATA (sub), GST_BUFFER_SIZE (sub));
         stream->name[GST_BUFFER_SIZE (sub)] = '\0';
         gst_buffer_unref (sub);
@@ -2019,7 +2020,8 @@ gst_avi_demux_process_next_entry (GstAviDemux * avi)
             GST_TIME_FORMAT " on pad %s",
             GST_BUFFER_SIZE (buf), GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
             gst_pad_get_name (stream->pad));
-        if ((res = gst_pad_push (stream->pad, buf)) != GST_FLOW_OK)
+        if (!((res = gst_pad_push (stream->pad, buf)) & (GST_FLOW_OK
+                    || GST_FLOW_NOT_LINKED)))
           return res;
         processed = TRUE;
       }