summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2012-08-03 23:55:47 +0100
committerTim-Philipp Müller <tim@centricular.net>2012-08-03 23:55:47 +0100
commit1be98dfa4b5dcc9f23381b97d032c5bacc6f684e (patch)
tree50c059e3aa62b74a4947fe97d55864998a016ae5 /gst
parent8add212ddfca6e27af48d9ebed25fa0fe01ffadc (diff)
qtdemux: fix invalid memory access with adpcm caps
Copy codec_data buffer to put into adpcm caps instead of just making its data point to the current buffer, which is going to get unrefed' Fixes crashes when trying to serialise those caps, in gst-launch -v or programmatically. https://bugzilla.gnome.org/show_bug.cgi?id=680726
Diffstat (limited to 'gst')
-rw-r--r--gst/isomp4/qtdemux.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
index 5583d86e9..eaa51d46c 100644
--- a/gst/isomp4/qtdemux.c
+++ b/gst/isomp4/qtdemux.c
@@ -7199,9 +7199,8 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
waveheader += 8;
headerlen -= 8;
- headerbuf = gst_buffer_new ();
- GST_BUFFER_DATA (headerbuf) = (guint8 *) waveheader;
- GST_BUFFER_SIZE (headerbuf) = headerlen;
+ headerbuf = gst_buffer_new_and_alloc (headerlen);
+ memcpy (GST_BUFFER_DATA (headerbuf), waveheader, headerlen);
if (gst_riff_parse_strf_auds (GST_ELEMENT_CAST (qtdemux),
headerbuf, &header, &extra)) {