[FFmpeg-cvslog] mpc8: fix channel checks

Michael Niedermayer git at videolan.org
Sat Jun 9 21:18:05 CEST 2012


ffmpeg | branch: release/0.7 | Michael Niedermayer <michaelni at gmx.at> | Sun Jun  3 17:40:30 2012 +0200| [5e87fa347c5b1c4b26a189c077158986d66ec6d7] | committer: Michael Niedermayer

mpc8: fix channel checks

fix heap array overflow

Found-by: Piotr Bandurski <ami_stuff at o2.pl>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 44c10168cff41c200825448b77cb8feff0d316c9)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/mpc8.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c
index 90bc8c8..4adc28e 100644
--- a/libavcodec/mpc8.c
+++ b/libavcodec/mpc8.c
@@ -138,7 +138,8 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx)
     c->frames = 1 << (get_bits(&gb, 3) * 2);
 
     avctx->sample_fmt = AV_SAMPLE_FMT_S16;
-    avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
+    avctx->channel_layout = (channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
+    avctx->channels = channels;
 
     if(vlc_initialized) return 0;
     av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n");



More information about the ffmpeg-cvslog mailing list