[FFmpeg-cvslog] avcodec_decode_audio: do not trust the channel layout, use the channel count.

Michael Niedermayer git at videolan.org
Fri Jan 18 01:38:24 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Jan 18 01:28:44 2013 +0100| [d270c3202539e8364c46410e15f7570800e33343] | committer: Michael Niedermayer

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 at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d270c3202539e8364c46410e15f7570800e33343
---

 libavcodec/utils.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 8c0aa98..12265a9 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 {



More information about the ffmpeg-cvslog mailing list