diff options
author | Rodger Combs <rodger.combs@gmail.com> | 2015-10-08 15:34:59 -0500 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-10-09 04:43:49 +0200 |
commit | 4f7d9b77061207142f93bd8c5c417ba189c25bd1 (patch) | |
tree | 27c6bd40d11fab08f1b1be0ff5e32136f3a54031 /libavformat/matroskadec.c | |
parent | b3f8d871eeda38991108db7151e6c396808b22fe (diff) | |
download | ffmpeg-4f7d9b77061207142f93bd8c5c417ba189c25bd1.tar.gz |
lavf/matroskadec: drop indexes that appear broken
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r-- | libavformat/matroskadec.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 9db2b59d4e..02cc6a5232 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1521,10 +1521,11 @@ static void matroska_add_index_entries(MatroskaDemuxContext *matroska) index_list = &matroska->index; index = index_list->elem; - if (index_list->nb_elem && - index[0].time > 1E14 / matroska->time_scale) { - av_log(matroska->ctx, AV_LOG_WARNING, "Working around broken index.\n"); - index_scale = matroska->time_scale; + if (index_list->nb_elem < 2) + return; + if (index[1].time > 1E14 / matroska->time_scale) { + av_log(matroska->ctx, AV_LOG_WARNING, "Dropping apparently-broken index.\n"); + return; } for (i = 0; i < index_list->nb_elem; i++) { EbmlList *pos_list = &index[i].pos; |