Although sample count and delta are in ISO 14496-12 specified as
unsigned files exists were interpreting it as signed integer makes
more sense (see mp4-negative-stts-problem.mp4).
Fixes an assert caused by negative avg_frame_rate deduced from a
negative duratoin computed in mov_read_stts() with the fuzzed sample
sample.mp4_s201788.
---
 libavformat/mov.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 35c07bd..8dbcc41 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1672,7 +1672,7 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
         sc->stts_data[i].count= sample_count;
         sc->stts_data[i].duration= sample_duration;
 
-        av_dlog(c->fc, "sample_count=%d, sample_duration=%d\n",
+        av_log(c->fc, AV_LOG_WARNING,"sample_count=%d, sample_duration=%d\n",
                 sample_count, sample_duration);
 
         duration+=(int64_t)sample_duration*sample_count;
@@ -1685,7 +1685,7 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
         return AVERROR_EOF;
 
     st->nb_frames= total_sample_count;
-    if (duration)
+    if (duration > 0)
         st->duration= duration;
     sc->track_end = duration;
     return 0;
-- 
1.7.12.4

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to