diff options
author | Edward Hervey <bilboed@bilboed.com> | 2005-08-04 18:31:12 +0000 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2005-08-04 18:31:12 +0000 |
commit | 6af187c535f54a4cd71aa85fe7b204b4cec2eac4 (patch) | |
tree | 5e05d609ab29885de7bf16f78c156164babff707 /gst | |
parent | 7e8df65cc2df0ddea9e943245c0ed0402306a50a (diff) |
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.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/avi/gstavidemux.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c index 3e6a4836..248ed869 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; } |