mov: Allow last chunk to have an arbitrary number of samples.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Sat, 3 Dec 2011 11:29:41 +0000 (12:29 +0100)
committerAlex Converse <alex.converse@gmail.com>
Tue, 6 Mar 2012 23:25:34 +0000 (15:25 -0800)
Fixes ticket #673.
(cherry picked from commit 8dcd2a41ecff8cc1e9b20cc267df54c59878ab3b)

Signed-off-by: Alex Converse <alex.converse@gmail.com>
libavformat/mov.c

index 701a1c1..7b21423 100644 (file)
@@ -1821,7 +1821,8 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
             unsigned count, chunk_count;
 
             chunk_samples = sc->stsc_data[i].count;
-            if (sc->samples_per_frame && chunk_samples % sc->samples_per_frame) {
+            if (i != sc->stsc_count - 1 &&
+                sc->samples_per_frame && chunk_samples % sc->samples_per_frame) {
                 av_log(mov->fc, AV_LOG_ERROR, "error unaligned chunk\n");
                 return;
             }