Browse Source

Merge commit 'c487972ed0e1eaebdbe4a13cdd191e119be0b19c'

* commit 'c487972ed0e1eaebdbe4a13cdd191e119be0b19c':
  ismindex: recover from completely empty streams

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Michael Niedermayer 10 years ago
parent
commit
d9a416fa1a
1 changed files with 6 additions and 0 deletions
  1. 6 0
      tools/ismindex.c

+ 6 - 0
tools/ismindex.c

@@ -328,6 +328,12 @@ static int handle_file(struct Tracks *tracks, const char *file, int split,
     for (i = 0; i < ctx->nb_streams; i++) {
     for (i = 0; i < ctx->nb_streams; i++) {
         struct Track **temp;
         struct Track **temp;
         AVStream *st = ctx->streams[i];
         AVStream *st = ctx->streams[i];
+
+        if (st->codec->bit_rate == 0) {
+            fprintf(stderr, "Skipping track %d in %s as it has zero bitrate\n", i, file);
+            continue;
+        }
+
         track = av_mallocz(sizeof(*track));
         track = av_mallocz(sizeof(*track));
         if (!track) {
         if (!track) {
             err = AVERROR(ENOMEM);
             err = AVERROR(ENOMEM);