From f0ab1f2048d6d04744957d75623ca5bd04fc23fa Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 6 Mar 2015 20:31:54 +0100 Subject: demux_mkv: actually skip elements out of reach This is missing from the previous commit. Not that harmful, but also slightly un-nice since even a failed seek will reset the cache. --- demux/demux_mkv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'demux') diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c index f46203111b..c9537995d8 100644 --- a/demux/demux_mkv.c +++ b/demux/demux_mkv.c @@ -1807,7 +1807,7 @@ static int demux_mkv_open(demuxer_t *demuxer, enum demux_check check) struct header_elem *elem = &mkv_d->headers[n]; if (elem->parsed) continue; - // Warn against incomplete files. + // Warn against incomplete files and skip headers outside of range. if (elem->pos >= end) { elem->parsed = true; // don't bother if file is incomplete if (!mkv_d->eof_warning) { @@ -1815,6 +1815,7 @@ static int demux_mkv_open(demuxer_t *demuxer, enum demux_check check) "end of file - incomplete file?\n"); mkv_d->eof_warning = true; } + continue; } if (elem->id == MATROSKA_ID_CUES) { // Read cues when they are needed, to avoid seeking on opening. -- cgit v1.2.3