From 6df1cfa7e4d488051d7b5033c0c69df970db9f82 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 3 Jun 2012 14:53:43 +0200 Subject: mace: check channel count, fixes FPE Fixes ticket1391 Found-by: Piotr Bandurski Signed-off-by: Michael Niedermayer --- libavcodec/mace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavcodec/mace.c') diff --git a/libavcodec/mace.c b/libavcodec/mace.c index bf9ea08fcf..dd721d24b5 100644 --- a/libavcodec/mace.c +++ b/libavcodec/mace.c @@ -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; -- cgit v1.2.3