mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-29 05:01:23 +00:00
mxfdemux: Keep tracking the offsets even when an index table was found
Some files may contain a partial index table, leading into a crash when you try seeking in them Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7626>
This commit is contained in:
parent
9a232f7983
commit
7cc16b64b7
1 changed files with 5 additions and 3 deletions
|
@ -2875,6 +2875,9 @@ gst_mxf_demux_handle_generic_container_essence_element (GstMXFDemux * demux,
|
|||
return ret;
|
||||
}
|
||||
|
||||
if (!etrack->offsets)
|
||||
etrack->offsets = g_array_new (FALSE, TRUE, sizeof (GstMXFDemuxIndex));
|
||||
|
||||
if (!index_entry.initialized) {
|
||||
/* This can happen when doing scanning without entry tables */
|
||||
index_entry.duration = 1;
|
||||
|
@ -2890,12 +2893,11 @@ gst_mxf_demux_handle_generic_container_essence_element (GstMXFDemux * demux,
|
|||
etrack->track_id, index_entry.dts, index_entry.offset,
|
||||
index_entry.keyframe);
|
||||
|
||||
if (!etrack->offsets)
|
||||
etrack->offsets = g_array_new (FALSE, TRUE, sizeof (GstMXFDemuxIndex));
|
||||
|
||||
/* We only ever append to the track offset entry. */
|
||||
g_assert (etrack->position <= etrack->offsets->len);
|
||||
g_array_insert_val (etrack->offsets, etrack->position, index_entry);
|
||||
} else if (etrack->position == etrack->offsets->len) {
|
||||
g_array_insert_val (etrack->offsets, etrack->position, index_entry);
|
||||
}
|
||||
|
||||
if (peek)
|
||||
|
|
Loading…
Reference in a new issue