diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c index 9bfb6ec598..5716f949fe 100644 --- a/gst/mxf/mxfdemux.c +++ b/gst/mxf/mxfdemux.c @@ -2016,8 +2016,15 @@ read_partition_header (GstMXFDemux * demux) return; } - while (mxf_is_index_table_segment (&key)) { - gst_mxf_demux_handle_index_table_segment (demux, &key, buf, demux->offset); + while (demux->offset < + demux->run_in + + demux->current_partition->partition.this_partition + + demux->current_partition->partition.header_byte_count + + demux->current_partition->partition.index_byte_count) { + if (mxf_is_index_table_segment (&key)) { + gst_mxf_demux_handle_index_table_segment (demux, &key, buf, + demux->offset); + } demux->offset += read; gst_buffer_unref (buf);