Skip to content

Instantly share code, notes, and snippets.

@rcombs

rcombs/stdin Secret

Created August 23, 2015 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rcombs/1be9f707d6e57a2d5197 to your computer and use it in GitHub Desktop.
Save rcombs/1be9f707d6e57a2d5197 to your computer and use it in GitHub Desktop.
commit 9bf8e68962b9697c8ae3c7ffa39a68ab3c54d27d
Author: Rodger Combs <rodger.combs@gmail.com>
Date: Sun Aug 23 01:48:30 2015 -0500
lavf/matroskadec: work around additional broken index cases
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index f97ae16..7f4a52b 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1520,8 +1520,10 @@ 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) {
+ if ((index_list->nb_elem &&
+ index[0].time > 1E14 / matroska->time_scale) ||
+ (index_list->nb_elem > 1 &&
+ index[1].time > 1E14 / matroska->time_scale)) {
av_log(matroska->ctx, AV_LOG_WARNING, "Working around broken index.\n");
index_scale = matroska->time_scale;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment