[FFmpeg-cvslog] avformat/flvdec: timestamps cannot use the full int64 range

Michael Niedermayer git at videolan.org
Mon Apr 18 19:06:07 EEST 2022


ffmpeg | branch: release/3.2 | Michael Niedermayer <michael at niedermayer.cc> | Thu Dec 23 20:36:16 2021 +0100| [da356c4edad595538511430d0eb436aa1c0af4b9] | committer: Michael Niedermayer

avformat/flvdec: timestamps cannot use the full int64 range

We do not support this as we multiply by 1000
Fixes: signed integer overflow: -45318575073853696 * 1000 cannot be represented in type 'long'
Fixes: 42804/clusterfuzz-testcase-minimized-ffmpeg_dem_LIVE_FLV_fuzzer-4630325425209344

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

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

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

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index da6f967262..b61ac7f973 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -422,6 +422,8 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc, int64_t m
             d = av_int2double(avio_rb64(ioc));
             if (isnan(d) || d < INT64_MIN || d > INT64_MAX)
                 goto invalid;
+            if (current_array == &times && (d <= INT64_MIN / 1000 || d >= INT64_MAX / 1000))
+                goto invalid;
             current_array[0][i] = d;
         }
         if (times && filepositions) {



More information about the ffmpeg-cvslog mailing list