mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
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.
This commit is contained in:
parent
34b81f7c93
commit
5b19be933b
1 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue