1
0
Fork 0

avcodec/dpcm: fix undefined interger overflow in wady

Fixes: signed integer overflow: -2147375930 + -133875 cannot be represented in type 'int'
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WADY_DPCM_fuzzer-6703727013920768

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-04-16 17:45:41 +02:00
parent 6e98cf0280
commit 8f0e200a12
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 1 additions and 1 deletions

View File

@ -444,7 +444,7 @@ static int dpcm_decode_frame(AVCodecContext *avctx, AVFrame *frame,
if (n & 0x80)
s->sample[idx] = sign_extend((n & 0x7f) << 9, 16);
else
s->sample[idx] += s->scale * wady_table[n & 0x7f];
s->sample[idx] += s->scale * (unsigned)wady_table[n & 0x7f];
*output_samples++ = av_clip_int16(s->sample[idx]);
idx ^= stereo;
}