]> git.sesse.net Git - ffmpeg/commitdiff
mov: Add support for zero-sized stsc runs.
authorAlex Converse <aconverse@google.com>
Mon, 28 Mar 2011 20:54:18 +0000 (13:54 -0700)
committerAnton Khirnov <anton@khirnov.net>
Thu, 31 Mar 2011 05:28:20 +0000 (07:28 +0200)
A zero sized stsc run doesn't make a lot of sense but the spec does not
prohibit them and MPlayer VLC demuxers support them.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavformat/mov.c

index 94f19a684a2bd5c1c538bfccd5d0ac61d44a843e..b57c1aab1c391b1216c6c130a32cb088743b4c2e 100644 (file)
@@ -1553,7 +1553,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
 
         for (i = 0; i < sc->chunk_count; i++) {
             current_offset = sc->chunk_offsets[i];
-            if (stsc_index + 1 < sc->stsc_count &&
+            while (stsc_index + 1 < sc->stsc_count &&
                 i + 1 == sc->stsc_data[stsc_index + 1].first)
                 stsc_index++;
             for (j = 0; j < sc->stsc_data[stsc_index].count; j++) {