[FFmpeg-cvslog] mov: validate sidx timescale

Andreas Cadhalpun git at videolan.org
Mon Nov 7 01:54:01 EET 2016


ffmpeg | branch: master | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Sun Oct 23 16:48:01 2016 +0200| [9d36602abc4ef5b69b92feadf868c77e5e9ccc7d] | committer: Andreas Cadhalpun

mov: validate sidx timescale

A negative timescale doesn't make sense and triggers assertions in
av_rescale_rnd.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9d36602abc4ef5b69b92feadf868c77e5e9ccc7d
---

 libavformat/mov.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 5fb345a..f06de06 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4247,6 +4247,11 @@ static int mov_read_sidx(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 
     timescale = av_make_q(1, avio_rb32(pb));
 
+    if (timescale.den <= 0) {
+        av_log(c->fc, AV_LOG_ERROR, "Invalid sidx timescale 1/%d\n", timescale.den);
+        return AVERROR_INVALIDDATA;
+    }
+
     if (version == 0) {
         pts = avio_rb32(pb);
         offset += avio_rb32(pb);



More information about the ffmpeg-cvslog mailing list