Allows playback of truncated matroska files.
authorAurelien Jacobs <aurel@gnuage.org>
Sun, 12 Nov 2006 16:59:27 +0000 (16:59 +0000)
committerAurelien Jacobs <aurel@gnuage.org>
Sun, 12 Nov 2006 16:59:27 +0000 (16:59 +0000)
Originally committed as revision 6989 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/matroska.c

index 758fe65c7f4c7f4193674f858094f9defab43bb3..7eca05b9b050a68c6a901464ddff72c2fd6604eb 100644 (file)
@@ -1942,7 +1942,7 @@ matroska_parse_seekhead (MatroskaDemuxContext *matroska)
                         /* check ID */
                         if (!(id = ebml_peek_id (matroska,
                                                  &matroska->level_up)))
-                            break;
+                            goto finish;
                         if (id != seek_id) {
                             av_log(matroska->ctx, AV_LOG_INFO,
                                    "We looked for ID=0x%x but got "
@@ -1954,7 +1954,7 @@ matroska_parse_seekhead (MatroskaDemuxContext *matroska)
 
                         /* read master + parse */
                         if ((res = ebml_read_master(matroska, &id)) < 0)
-                            break;
+                            goto finish;
                         switch (id) {
                             case MATROSKA_ID_CUES:
                                 if (!(res = matroska_parse_index(matroska)) ||
@@ -1971,8 +1971,6 @@ matroska_parse_seekhead (MatroskaDemuxContext *matroska)
                                 }
                                 break;
                         }
-                        if (res < 0)
-                            break;
 
                     finish:
                         /* remove dummy level */