diff options
author | Matthieu Bouron <matthieu.bouron@collabora.com> | 2013-08-06 16:53:37 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2013-08-09 23:36:33 +0100 |
commit | 86edc51333048916098b0497efb5bf6a4c189c6f (patch) | |
tree | d29dcbc581fe115db707f5e0279652b88514dce8 /gst/aiff | |
parent | 3384e6a7386f267279c66c60a4ca8e571b1a8891 (diff) | |
download | gstreamer-plugins-bad-86edc51333048916098b0497efb5bf6a4c189c6f.tar.gz |
aiffparse: fix buffers initialisation
https://bugzilla.gnome.org/show_bug.cgi?id=705674
Diffstat (limited to 'gst/aiff')
-rw-r--r-- | gst/aiff/aiffparse.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gst/aiff/aiffparse.c b/gst/aiff/aiffparse.c index 77fbdcae8..a4ce3f7fa 100644 --- a/gst/aiff/aiffparse.c +++ b/gst/aiff/aiffparse.c @@ -708,7 +708,7 @@ gst_aiff_parse_read_chunk (GstAiffParse * aiff, guint64 * offset, guint32 * tag, { guint size; GstFlowReturn res; - GstBuffer *buf; + GstBuffer *buf = NULL; GstMapInfo info; if ((res = @@ -720,6 +720,7 @@ gst_aiff_parse_read_chunk (GstAiffParse * aiff, guint64 * offset, guint32 * tag, size = GST_READ_UINT32_BE (info.data + 4); gst_buffer_unmap (buf, &info); gst_buffer_unref (buf); + buf = NULL; if ((res = gst_pad_pull_range (aiff->sinkpad, (*offset) + 8, size, @@ -796,7 +797,7 @@ static GstFlowReturn gst_aiff_parse_stream_headers (GstAiffParse * aiff) { GstFlowReturn res; - GstBuffer *buf; + GstBuffer *buf = NULL; guint32 tag, size; gboolean gotdata = FALSE; gboolean done = FALSE; @@ -823,6 +824,8 @@ gst_aiff_parse_stream_headers (GstAiffParse * aiff) tag = GST_READ_UINT32_LE (info.data); size = GST_READ_UINT32_BE (info.data + 4); gst_buffer_unmap (buf, &info); + gst_buffer_unref (buf); + buf = NULL; } GST_INFO_OBJECT (aiff, @@ -896,7 +899,6 @@ gst_aiff_parse_stream_headers (GstAiffParse * aiff) GstBuffer *ssndbuf = NULL; GstMapInfo info; - gst_buffer_unref (buf); if ((res = gst_pad_pull_range (aiff->sinkpad, aiff->offset, 16, &ssndbuf)) != GST_FLOW_OK) @@ -971,6 +973,8 @@ gst_aiff_parse_stream_headers (GstAiffParse * aiff) gst_aiff_parse_ignore_chunk (aiff, buf, tag, size); } + buf = NULL; + if (upstream_size && (aiff->offset >= upstream_size)) { /* Now we have gone through the whole file */ done = TRUE; |