[FFmpeg-cvslog] avformat/mccdec: Initialize and check rate.den

Michael Niedermayer git at videolan.org
Mon Nov 11 02:30:22 EET 2024


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Nov  3 20:18:36 2024 +0100| [bf8e43083f68c383b9d905d2c8c791ac33ecc7bc] | committer: Michael Niedermayer

avformat/mccdec: Initialize and check rate.den

Fixes: Assertion c > 0 failed at libavutil/mathematics.c:61
Fixes: use-of-uninitialized-value
Fixes: 42537627/clusterfuzz-testcase-minimized-fuzzer_protocol_memory-5939605805793280

Found-by: ossfuzz
Reported-by: Kacper Michajlow
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/mccdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/mccdec.c b/libavformat/mccdec.c
index 85bf93cd3b..8c0ea09b6b 100644
--- a/libavformat/mccdec.c
+++ b/libavformat/mccdec.c
@@ -93,7 +93,7 @@ static int mcc_read_header(AVFormatContext *s)
 {
     MCCContext *mcc = s->priv_data;
     AVStream *st = avformat_new_stream(s, NULL);
-    AVRational rate;
+    AVRational rate = {0};
     int64_t ts, pos;
     uint8_t out[4096];
     char line[4096];
@@ -139,7 +139,7 @@ static int mcc_read_header(AVFormatContext *s)
             continue;
         }
 
-        if (av_sscanf(line, "%d:%d:%d:%d", &hh, &mm, &ss, &fs) != 4)
+        if (av_sscanf(line, "%d:%d:%d:%d", &hh, &mm, &ss, &fs) != 4 || rate.den <= 0)
             continue;
 
         ts = av_sat_add64(av_rescale(hh * 3600LL + mm * 60LL + ss, rate.num, rate.den), fs);



More information about the ffmpeg-cvslog mailing list