1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

mace: check channel count, fixes FPE

Fixes ticket1391

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-06-03 14:53:43 +02:00
parent cc229d4e83
commit 6df1cfa7e4

View File

@ -231,7 +231,7 @@ static av_cold int mace_decode_init(AVCodecContext * avctx)
{
MACEContext *ctx = avctx->priv_data;
if (avctx->channels > 2)
if (avctx->channels > 2 || avctx->channels <= 0)
return -1;
avctx->sample_fmt = AV_SAMPLE_FMT_S16;