]> git.sesse.net Git - ffmpeg/commitdiff
avformat/utils: Check dts in update_initial_timestamps() more
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 16 Jan 2021 21:05:53 +0000 (22:05 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 26 Jan 2021 17:37:12 +0000 (18:37 +0100)
Fixes: signed integer overflow: -9223372036853488158 - 90000000 cannot be represented in type 'long long'
Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_MPSUB_fuzzer-6696625298866176
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/utils.c

index 6f100294a11218accec39c99fe1aa5237b4f4dcd..1ec71691e5e6f7dafbe81defce227fa6faaa0947 100644 (file)
@@ -1106,6 +1106,7 @@ static void update_initial_timestamps(AVFormatContext *s, int stream_index,
         dts           == AV_NOPTS_VALUE ||
         st->cur_dts   == AV_NOPTS_VALUE ||
         st->cur_dts < INT_MIN + RELATIVE_TS_BASE ||
+        dts  < INT_MIN + (st->cur_dts - RELATIVE_TS_BASE) ||
         is_relative(dts))
         return;