ext/mad/gstid3tag.c: fix huge leak: gst_buffer_merge doesn't unref the first argument itself.

Original commit message from CVS:
* ext/mad/gstid3tag.c: (gst_id3_tag_chain):
fix huge leak: gst_buffer_merge doesn't unref the first argument
itself.
This commit is contained in:
Benjamin Otte 2004-03-06 19:32:50 +00:00
parent 9dcd265258
commit f7dc1e4722
2 changed files with 14 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2004-03-06 Benjamin Otte <otte@gnome.org>
* ext/mad/gstid3tag.c: (gst_id3_tag_chain):
fix huge leak: gst_buffer_merge doesn't unref the first argument
itself.
2004-03-06 Thomas Vander Stichele <thomas at apestaart dot org> 2004-03-06 Thomas Vander Stichele <thomas at apestaart dot org>
* ext/mad/gstmad.c: (gst_mad_class_init), (gst_mad_update_info): * ext/mad/gstmad.c: (gst_mad_class_init), (gst_mad_update_info):

View file

@ -867,7 +867,10 @@ gst_id3_tag_chain (GstPad *pad, GstData *data)
return; return;
case GST_ID3_TAG_STATE_READING_V1_TAG: case GST_ID3_TAG_STATE_READING_V1_TAG:
if (tag->buffer) { if (tag->buffer) {
tag->buffer = gst_buffer_merge (tag->buffer, buffer); GstBuffer *temp;
temp = gst_buffer_merge (tag->buffer, buffer);
gst_data_unref (GST_DATA (tag->buffer));
tag->buffer = temp;
gst_data_unref (GST_DATA (buffer)); gst_data_unref (GST_DATA (buffer));
} else { } else {
tag->buffer = buffer; tag->buffer = buffer;
@ -923,7 +926,10 @@ gst_id3_tag_chain (GstPad *pad, GstData *data)
return; return;
case GST_ID3_TAG_STATE_READING_V2_TAG: case GST_ID3_TAG_STATE_READING_V2_TAG:
if (tag->buffer) { if (tag->buffer) {
tag->buffer = gst_buffer_merge (tag->buffer, buffer); GstBuffer *temp;
temp = gst_buffer_merge (tag->buffer, buffer);
gst_data_unref (GST_DATA (tag->buffer));
tag->buffer = temp;
gst_data_unref (GST_DATA (buffer)); gst_data_unref (GST_DATA (buffer));
} else { } else {
tag->buffer = buffer; tag->buffer = buffer;