aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-18 01:28:44 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-19 16:18:08 +0100
commit43c6b45a53a186a187f7266e4d6bd3c2620519f1 (patch)
treec0ce131d61c0f261693a44294700dbedb6c5b181
parent68a0477bc0af026db971ddba22541029a9e8715b (diff)
downloadffmpeg-43c6b45a53a186a187f7266e4d6bd3c2620519f1.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) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 8c0aa9818e..12265a95ea 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1809,7 +1809,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
* extended_data are doing it correctly */
if (*got_frame_ptr) {
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;
} else {