[FFmpeg-devel] [PATCH 3/4] avformat/mccdec: Fix overflows in num/den
James Almer
jamrial at gmail.com
Sat Apr 24 19:04:48 EEST 2021
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?
> }
> }
>
>
More information about the ffmpeg-devel
mailing list