Commit c57500a7 authored by Philip Withnall's avatar Philip Withnall Committed by Sebastian Dröge

opus: Fix a double-unref in the Opus header code

The headers were never getting reffed when being added to the headers
list, which is later unreffed-and-freed by the caller (e.g.
parent ba7d57c1
...@@ -190,8 +190,8 @@ gst_opus_header_create_caps_from_headers (GstCaps ** caps, GSList ** headers, ...@@ -190,8 +190,8 @@ gst_opus_header_create_caps_from_headers (GstCaps ** caps, GSList ** headers,
"multistream", G_TYPE_BOOLEAN, multistream, NULL); "multistream", G_TYPE_BOOLEAN, multistream, NULL);
*caps = _gst_caps_set_buffer_array (*caps, "streamheader", buf1, buf2, NULL); *caps = _gst_caps_set_buffer_array (*caps, "streamheader", buf1, buf2, NULL);
*headers = g_slist_prepend (*headers, buf2); *headers = g_slist_prepend (*headers, gst_buffer_ref (buf2));
*headers = g_slist_prepend (*headers, buf1); *headers = g_slist_prepend (*headers, gst_buffer_ref (buf1));
} }
void void
...@@ -218,6 +218,9 @@ gst_opus_header_create_caps (GstCaps ** caps, GSList ** headers, gint nchannels, ...@@ -218,6 +218,9 @@ gst_opus_header_create_caps (GstCaps ** caps, GSList ** headers, gint nchannels,
buf2 = gst_opus_enc_create_metadata_buffer (tags); buf2 = gst_opus_enc_create_metadata_buffer (tags);
gst_opus_header_create_caps_from_headers (caps, headers, buf1, buf2); gst_opus_header_create_caps_from_headers (caps, headers, buf1, buf2);
gst_buffer_unref (buf2);
gst_buffer_unref (buf1);
} }
gboolean gboolean
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