[FFmpeg-devel] [PATCH 3/4] avformat/mccdec: Fix overflows in num/den

Michael Niedermayer michael at niedermayer.cc
Thu Jun 17 23:55:44 EEST 2021


On Sat, Apr 24, 2021 at 01:04:48PM -0300, James Almer wrote:
> On 4/24/2021 12:59 PM, Michael Niedermayer wrote:
> > Fixes: signed integer overflow: 6365816 * 1000 cannot be represented in type 'int'
> > Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_MCC_fuzzer-6737934184218624
> > 
> > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> > ---
> >   libavformat/mccdec.c | 3 +--
> >   1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/libavformat/mccdec.c b/libavformat/mccdec.c
> > index 2a0b7905a0..7671be61d4 100644
> > --- a/libavformat/mccdec.c
> > +++ b/libavformat/mccdec.c
> > @@ -127,8 +127,7 @@ static int mcc_read_header(AVFormatContext *s)
> >                   num = strtol(rate_str, &df, 10);
> >                   den = 1;
> >                   if (df && !av_strncasecmp(df, "DF", 2)) {
> > -                    num *= 1000;
> > -                    den  = 1001;
> > +                    av_reduce(&num, &den, num * 1000LL, 10001, INT_MAX);
> 
> 10001?

will apply with a 0 less

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Elect your leaders based on what they did after the last election, not
based on what they say before an election.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210617/0262f00a/attachment.sig>


More information about the ffmpeg-devel mailing list