diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-18 01:28:44 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-07 01:00:02 +0100 |
commit | 4cd1dad91ae97fe1f0dd534c3f5566787566f137 (patch) | |
tree | 4f02bd6e99a76430ef8f974a2891ee58b966a0be /libavcodec | |
parent | 3e196e4def03c7a91423803402f84d638d316c33 (diff) | |
download | ffmpeg-4cd1dad91ae97fe1f0dd534c3f5566787566f137.tar.gz |
avcodec_decode_audio: do not trust the channel layout, use the channel count.
Fixes memory corruption
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d270c3202539e8364c46410e15f7570800e33343)
Conflicts:
libavcodec/utils.c
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 00434c9114..384d457f61 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1744,7 +1744,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx, * make sure it's set correctly; assume decoders that actually use * extended_data are doing it correctly */ planar = av_sample_fmt_is_planar(frame->format); - channels = av_get_channel_layout_nb_channels(frame->channel_layout); + channels = frame->channels; if (!(planar && channels > AV_NUM_DATA_POINTERS)) frame->extended_data = frame->data; |