From 6af187c535f54a4cd71aa85fe7b204b4cec2eac4 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 4 Aug 2005 18:31:12 +0000 Subject: [PATCH] gst/avi/gstavidemux.c: You need to allocatate (len+1) characters to store a len size string. 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 | 7 +++++++ gst/avi/gstavidemux.c | 8 +++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 75c5df246..fa8196d41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-08-04 Edward Hervey + + * 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 * ext/gconf/gstgconfaudiosink.c: (gst_gconf_audio_sink_reset), diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c index 3e6a4836f..248ed869d 100644 --- a/gst/avi/gstavidemux.c +++ b/gst/avi/gstavidemux.c @@ -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; } -- 2.34.1