1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

lavf/matroskadec: drop indexes that appear broken

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Rodger Combs 2015-10-08 15:34:59 -05:00 committed by Michael Niedermayer
parent b3f8d871ee
commit 4f7d9b7706

View File

@ -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;