diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-06-03 19:40:30 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-09 22:50:14 +0400 |
commit | 944b6a801e0bb582978be123f4b05994fdeed4bb (patch) | |
tree | 43f6df224f3d297718bee437de8216e08300c7f5 | |
parent | ddd9483a105a1b51e23fef0975b69cdf1052a0ce (diff) |
mpc8: fix channel checks
fix heap array overflow
Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 44c10168cff41c200825448b77cb8feff0d316c9)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/mpc8.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c index a4750ad961..ebf00e155b 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"); |