diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-11 04:36:15 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-11 04:37:27 +0100 |
commit | e11983bda073f8c63f60509ee753da9fba20ed10 (patch) | |
tree | f146e375adc13fdc5f8bf8350f355b5f7d75159b /libavcodec/alac.c | |
parent | 9d5cc55f0fdf1f7b7dd729d7befb45923c0de181 (diff) | |
download | ffmpeg-e11983bda073f8c63f60509ee753da9fba20ed10.tar.gz |
avcodec/alac: only set *got_frame_ptr when all channels have been decoded
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f8b64436530_7895_quicktime_newcodec_applelosslessaudiocodec.m4a
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/alac.c')
-rw-r--r-- | libavcodec/alac.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c index 3f37f61883..1929839e70 100644 --- a/libavcodec/alac.c +++ b/libavcodec/alac.c @@ -490,7 +490,8 @@ static int alac_decode_frame(AVCodecContext *avctx, void *data, avpkt->size * 8 - get_bits_count(&alac->gb)); } - *got_frame_ptr = 1; + if (alac->channels == ch) + *got_frame_ptr = 1; return avpkt->size; } |