ffmpeg | branch: release/7.1 | Michael Niedermayer <mich...@niedermayer.cc> | 
Sun Jul 28 22:08:23 2024 +0200| [631976108ca815d921f13dfc056e620835af70ef] | 
committer: Michael Niedermayer

avformat/matroskadec: Check desc_bytes so bits fit in 64bit

Likely a tighter check can be done

Fixes: signed integer overflow: 3305606804154370442 * 8 cannot be represented 
in type 'long'
Fixes: 
70449/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-4771166007918592

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

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

 libavformat/matroskadec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index a2947c97e7..0e150f9138 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -4633,7 +4633,7 @@ static int64_t 
webm_dash_manifest_compute_bandwidth(AVFormatContext *s, int64_t
                 int64_t desc_bytes = desc_end.end_offset - 
desc_beg.start_offset;
                 int64_t desc_ns = desc_end.end_time_ns - 
desc_beg.start_time_ns;
                 double desc_sec, calc_bits_per_second, percent, 
mod_bits_per_second;
-                if (desc_bytes <= 0)
+                if (desc_bytes <= 0 || desc_bytes > INT64_MAX/8)
                     return -1;
 
                 desc_sec = desc_ns / nano_seconds_per_second;

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to