summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorThierry Foucu <tfoucu@gmail.com>2011-08-12 16:27:59 -0700
committerMichael Niedermayer <michaelni@gmx.at>2011-08-13 03:39:58 +0200
commit1892052f8dee858dcab3292d1c40c5deef67e18f (patch)
tree62ef6313ced4938b8bc39ecffd471059bfac5d07 /libavformat
parent8c6b8cb4d1b9d53c633d5a0227e057bda3f425a0 (diff)
mov: Set negative Sample_duration in STTS to 1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mov.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index fdb29a01bf..96a99280e1 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1471,6 +1471,11 @@ 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) {
+ av_log(c->fc, AV_LOG_ERROR, "Invalid SampleDelta in STTS %d", sample_duration);
+ sample_duration = 1;
+ }
sc->stts_data[i].count= sample_count;
sc->stts_data[i].duration= sample_duration;