[FFmpeg-cvslog] avformat/matroskadec: Check timescale

Michael Niedermayer git at videolan.org
Mon Apr 15 01:48:52 EEST 2024


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Tue Mar 26 00:57:33 2024 +0100| [ecd23c0b0c80a8bd8ccdb56d3748dc0633f56522] | committer: Michael Niedermayer

avformat/matroskadec: Check timescale

Fixes: 3.82046e+18 is outside the range of representable values of type 'unsigned int'
Fixes: 62276/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-6381436594421760

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 e849eb23432e45d0a1fda3901bb84eff0ce91282)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/matroskadec.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 6126a24a8b..58993cdd67 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1992,6 +1992,10 @@ static int matroska_parse_tracks(AVFormatContext *s)
 
         if (track->time_scale < 0.01)
             track->time_scale = 1.0;
+
+        if (matroska->time_scale * track->time_scale > UINT_MAX)
+            return AVERROR_INVALIDDATA;
+
         avpriv_set_pts_info(st, 64, matroska->time_scale * track->time_scale,
                             1000 * 1000 * 1000);    /* 64 bit pts in ns */
 



More information about the ffmpeg-cvslog mailing list