[FFmpeg-devel] [PATCH] mov: Set negative Sample_duration in STTS to 1

Thierry Foucu tfoucu at gmail.com
Fri Aug 12 02:36:49 CEST 2011


---
 libavformat/mov.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index fdb29a0..c714a2c 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1471,6 +1471,8 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 
         sample_count=avio_rb32(pb);
         sample_duration = avio_rb32(pb);
+        /* sample_duration < 0 is invalid based on the spec */
+        if (sample_duration < 0) sample_duration = 1;
         sc->stts_data[i].count= sample_count;
         sc->stts_data[i].duration= sample_duration;
 
-- 
1.7.3.1



More information about the ffmpeg-devel mailing list