avcodec/alacdsp: Fix invalid shift in append_extra_bits()

Fixes: left shift of negative value -1
Fixes: 21390/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-6242539519868928

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/338/head
Michael Niedermayer 5 years ago
parent 62e4003780
commit 49ae034b42
  1. 2
      libavcodec/alacdsp.c

@ -49,7 +49,7 @@ static void append_extra_bits(int32_t *buffer[2], int32_t *extra_bits_buffer[2],
for (ch = 0; ch < channels; ch++)
for (i = 0; i < nb_samples; i++)
buffer[ch][i] = (buffer[ch][i] << extra_bits) | extra_bits_buffer[ch][i];
buffer[ch][i] = ((unsigned)buffer[ch][i] << extra_bits) | extra_bits_buffer[ch][i];
}
av_cold void ff_alacdsp_init(ALACDSPContext *c)

Loading…
Cancel
Save