Commit e9a4c4fe authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/wmalosslessdec: Fix integer overflows in revert_inter_ch_decorr()

Fixes: signed integer overflow: -717241856 + -1434459904 cannot be represented in type 'int'
Fixes: 21405/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5677143666458624

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent a3dc67c9
...@@ -790,8 +790,8 @@ static void revert_inter_ch_decorr(WmallDecodeCtx *s, int tile_size) ...@@ -790,8 +790,8 @@ static void revert_inter_ch_decorr(WmallDecodeCtx *s, int tile_size)
else if (s->is_channel_coded[0] || s->is_channel_coded[1]) { else if (s->is_channel_coded[0] || s->is_channel_coded[1]) {
int icoef; int icoef;
for (icoef = 0; icoef < tile_size; icoef++) { for (icoef = 0; icoef < tile_size; icoef++) {
s->channel_residues[0][icoef] -= s->channel_residues[1][icoef] >> 1; s->channel_residues[0][icoef] -= (unsigned)(s->channel_residues[1][icoef] >> 1);
s->channel_residues[1][icoef] += s->channel_residues[0][icoef]; s->channel_residues[1][icoef] += (unsigned) s->channel_residues[0][icoef];
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment