Commit 9c49fa71 authored by Jonathan Matthew's avatar Jonathan Matthew Committed by Tim-Philipp Müller
Browse files

gst/wavparse/gstwavparse.c: Fix massive memory leak when operating in streaming mode due to

Original commit message from CVS:
Based on patch by: Jonathan Matthew  <jonathan at kaolin wh9 net>
* gst/wavparse/gstwavparse.c: (gst_wavparse_parse_stream_init),
(gst_wavparse_stream_data):
Fix massive memory leak when operating in streaming mode due to
GST_BUFFER_MALLOCDATA() not being set on newly-created buffers.
Fixes #407057.
parent 114afecd
2007-02-12 Tim-Philipp Müller <tim at centricular dot net>
Based on patch by: Jonathan Matthew <jonathan at kaolin wh9 net>
* gst/wavparse/gstwavparse.c: (gst_wavparse_parse_stream_init),
(gst_wavparse_stream_data):
Fix massive memory leak when operating in streaming mode due to
GST_BUFFER_MALLOCDATA() not being set on newly-created buffers.
Fixes #407057.
2007-02-12 Stefan Kost <ensonic@users.sf.net>
* gst/avi/gstavidemux.c: (gst_avi_demux_class_init),
......
......@@ -1319,12 +1319,10 @@ static GstFlowReturn
gst_wavparse_parse_stream_init (GstWavParse * wav)
{
if (gst_adapter_available (wav->adapter) >= 12) {
GstBuffer *tmp = gst_buffer_new ();
GstBuffer *tmp;
/* _take flushes the data */
GST_BUFFER_DATA (tmp) = gst_adapter_take (wav->adapter, 12);
GST_BUFFER_SIZE (tmp) = 12;
tmp = gst_adapter_take_buffer (wav->adapter, 12);
GST_DEBUG ("Parsing wav header");
if (!gst_wavparse_parse_file_header (GST_ELEMENT (wav), tmp)) {
return GST_FLOW_ERROR;
......@@ -1458,9 +1456,7 @@ iterate_adapter:
return GST_FLOW_OK;
}
buf = gst_buffer_new ();
GST_BUFFER_DATA (buf) = gst_adapter_take (wav->adapter, desired);
GST_BUFFER_SIZE (buf) = desired;
buf = gst_adapter_take_buffer (wav->adapter, desired);
} else {
if ((res = gst_pad_pull_range (wav->sinkpad, wav->offset,
desired, &buf)) != GST_FLOW_OK)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment