summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-06-03 14:53:43 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-06-03 15:01:34 +0200
commit6df1cfa7e4d488051d7b5033c0c69df970db9f82 (patch)
tree3fa0831895d6df09e7e07a3cf78b2c6fa6ff88c1 /libavcodec
parentcc229d4e83889d1298f1a0863b55feec6c5c339a (diff)
mace: check channel count, fixes FPE
Fixes ticket1391 Found-by: Piotr Bandurski <ami_stuff@o2.pl> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mace.c2
1 files changed, 1 insertions, 1 deletions
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;