[FFmpeg-cvslog] avformat/pjsdec: Check duration for overflow

Michael Niedermayer git at videolan.org
Sun Oct 20 21:00:03 EEST 2019


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Fri Oct  4 17:10:38 2019 +0200| [1efaac69328bdc17680924c71be7ec990f0e8f2c] | committer: Michael Niedermayer

avformat/pjsdec: Check duration for overflow

Fixes: signed integer overflow: -3 - 9223372036854775807 cannot be represented in type 'long'
Fixes: 17828/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5645915116797952

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/pjsdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/pjsdec.c b/libavformat/pjsdec.c
index 50b1a48e4e..8a5cc04f84 100644
--- a/libavformat/pjsdec.c
+++ b/libavformat/pjsdec.c
@@ -55,6 +55,8 @@ static int64_t read_ts(char **line, int *duration)
     if (sscanf(*line, "%"SCNd64",%"SCNd64, &start, &end) == 2) {
         *line += strcspn(*line, "\"");
         *line += !!**line;
+        if (end < start || end - (uint64_t)start > INT_MAX)
+            return AV_NOPTS_VALUE;
         *duration = end - start;
         return start;
     }



More information about the ffmpeg-cvslog mailing list