mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-25 00:06:58 +00:00
avcodec/alac: Fix invalid shifts in 20/24 bps
Fixes: left shift of negative value -256
Fixes: 16892/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-4880802642395136
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b30c07cc2b
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
dcb101dbd7
commit
69000f77bc
@ -394,13 +394,13 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
|
|||||||
case 20: {
|
case 20: {
|
||||||
for (ch = 0; ch < channels; ch++) {
|
for (ch = 0; ch < channels; ch++) {
|
||||||
for (i = 0; i < alac->nb_samples; i++)
|
for (i = 0; i < alac->nb_samples; i++)
|
||||||
alac->output_samples_buffer[ch][i] <<= 12;
|
alac->output_samples_buffer[ch][i] *= 1 << 12;
|
||||||
}}
|
}}
|
||||||
break;
|
break;
|
||||||
case 24: {
|
case 24: {
|
||||||
for (ch = 0; ch < channels; ch++) {
|
for (ch = 0; ch < channels; ch++) {
|
||||||
for (i = 0; i < alac->nb_samples; i++)
|
for (i = 0; i < alac->nb_samples; i++)
|
||||||
alac->output_samples_buffer[ch][i] <<= 8;
|
alac->output_samples_buffer[ch][i] *= 1 << 8;
|
||||||
}}
|
}}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user