aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/matroskadec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-22 04:21:39 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-22 13:40:28 +0200
commita39201818feab04c029f5b17bad2e7f40c1f2eab (patch)
treecf01bcba30a8edcb143c7be9a5296b9844089350 /libavformat/matroskadec.c
parente397edbfbab099ef63e292156a11d4cd733146c6 (diff)
downloadffmpeg-a39201818feab04c029f5b17bad2e7f40c1f2eab.tar.gz
avformat/matroskadec: Fix cluster parsing loop which gathers seek information
Fixes Ticket2263 Fixes Ticket3934 Reviewed-by: Rodger Combs <rodger.combs@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r--libavformat/matroskadec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index b742319b9a..2ef32223ec 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2921,11 +2921,11 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
goto err;
timestamp = FFMAX(timestamp, st->index_entries[0].timestamp);
- if ((index = av_index_search_timestamp(st, timestamp, flags)) < 0) {
+ if ((index = av_index_search_timestamp(st, timestamp, flags)) < 0 || index == st->nb_index_entries - 1) {
avio_seek(s->pb, st->index_entries[st->nb_index_entries - 1].pos,
SEEK_SET);
matroska->current_id = 0;
- while ((index = av_index_search_timestamp(st, timestamp, flags)) < 0) {
+ while ((index = av_index_search_timestamp(st, timestamp, flags)) < 0 || index == st->nb_index_entries - 1) {
matroska_clear_queue(matroska);
if (matroska_parse_cluster(matroska) < 0)
break;