[FFmpeg-cvslog] avformat/oggdec: Fix integer overflow with invalid pts

Michael Niedermayer git at videolan.org
Fri Aug 26 15:41:04 EEST 2016


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Wed Aug  3 13:34:40 2016 +0200| [942c3bfbdfd17cd3778343fe7d3db3048b6e7305] | committer: Michael Niedermayer

avformat/oggdec: Fix integer overflow with invalid pts

If negative pts are possible for some codecs in ogg then the code needs to be
changed to use signed values.

Found-by: Thomas Guilbert <tguilbert at google.com>
Fixes: clusterfuzz_usan-2016-08-02
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit c5cc3b08e56fc95665977544486bd9f06e4b7a72)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/oggdec.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/oggdec.h b/libavformat/oggdec.h
index 7dc7716..c52604f 100644
--- a/libavformat/oggdec.h
+++ b/libavformat/oggdec.h
@@ -161,6 +161,11 @@ ogg_gptopts (AVFormatContext * s, int i, uint64_t gp, int64_t *dts)
         if (dts)
             *dts = pts;
     }
+    if (pts > INT64_MAX && pts != AV_NOPTS_VALUE) {
+        // The return type is unsigned, we thus cannot return negative pts
+        av_log(s, AV_LOG_ERROR, "invalid pts %"PRId64"\n", pts);
+        pts = AV_NOPTS_VALUE;
+    }
 
     return pts;
 }



More information about the ffmpeg-cvslog mailing list