Commit 44c10168 authored by Michael Niedermayer's avatar Michael Niedermayer

mpc8: fix channel checks

fix heap array overflow
Found-by: 's avatarPiotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent a5ad3c23
......@@ -140,7 +140,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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment