diff options
author | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2013-02-18 20:04:05 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2013-02-18 20:04:05 +0000 |
commit | 5b19be933b36d5dd9c203b0f658ca46bd946f267 (patch) | |
tree | 9f75515322d1de2eb36903dda1bbc497397c4cf2 | |
parent | 34b81f7c93fd09db77ebb58301de5ef967c15157 (diff) |
qtdemux: fix up dodgy code that tries to fix up a broken moov atom
After gst_buffer_new_and_alloc() gst_buffer_copy_into() will likely
append to the already-existing memory instead of filling it.
-rw-r--r-- | gst/isomp4/qtdemux.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index 21f1efbba..aac25c612 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -2767,12 +2767,12 @@ gst_qtdemux_loop_state_header (GstQTDemux * qtdemux) /* Ok, we've found that special case. Allocate a new buffer with * that free atom actually present. */ GstBuffer *newmoov = gst_buffer_new_and_alloc (length); - gst_buffer_copy_into (newmoov, moov, 0, 0, map.size); + gst_buffer_fill (newmoov, 0, map.data, map.size); + gst_buffer_memset (newmoov, map.size, 0, final_length - 8); gst_buffer_unmap (moov, &map); - gst_buffer_map (newmoov, &map, GST_MAP_WRITE); - memset (map.data + length - final_length + 8, 0, final_length - 8); gst_buffer_unref (moov); moov = newmoov; + gst_buffer_map (moov, &map, GST_MAP_READ); } } } |