diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-08-21 01:42:20 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-08-25 03:29:36 +0200 |
commit | 4943abe05110562870b9f4d5e0ac85feb9ae2a63 (patch) | |
tree | 568c22b6853de00dd73fb136215abd6209c443f1 | |
parent | 8c4a67183b0790735cc4611015a3a66c2616f6f1 (diff) | |
download | ffmpeg-4943abe05110562870b9f4d5e0ac85feb9ae2a63.tar.gz |
avcodec/adpcm: Fix adpcm_ima_wav padding
Fixes out of array read
Fixes: f29f134ea5f5590df554a7733294a587/asan_stack-oob_309d14e_9188_ea01743d6355aff20530f3d4cdaa841a.wav
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f2a9a30fd6a2914197ae42ee67703a1471fac2eb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/adpcm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index 46c63a2752..06ba83e3c3 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -803,7 +803,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data, if (avctx->bits_per_coded_sample != 4) { int samples_per_block = ff_adpcm_ima_block_samples[avctx->bits_per_coded_sample - 2]; int block_size = ff_adpcm_ima_block_sizes[avctx->bits_per_coded_sample - 2]; - uint8_t temp[20] = { 0 }; + uint8_t temp[20 + AV_INPUT_BUFFER_PADDING_SIZE] = { 0 }; GetBitContext g; for (n = 0; n < (nb_samples - 1) / samples_per_block; n++) { |