1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

avcodec/osq: fix integer overflow when applying factor

Fixes: signed integer overflow: -35511773 * 256 cannot be represented in type 'int'
Fixes: 70406/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-6545326804434944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2023-09-15 00:49:41 +02:00
parent 56c334d732
commit 6420c1bf30
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -356,7 +356,7 @@ static int osq_decode_block(AVCodecContext *avctx, AVFrame *frame)
const int nb_channels = avctx->ch_layout.nb_channels; const int nb_channels = avctx->ch_layout.nb_channels;
const int nb_samples = frame->nb_samples; const int nb_samples = frame->nb_samples;
OSQContext *s = avctx->priv_data; OSQContext *s = avctx->priv_data;
const int factor = s->factor; const unsigned factor = s->factor;
int ret, decorrelate, downsample; int ret, decorrelate, downsample;
GetBitContext *gb = &s->gb; GetBitContext *gb = &s->gb;