aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-06-03 14:53:43 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-06-07 00:55:25 +0200
commitbe1d65031fecdce619de8831b7802bfba1932869 (patch)
tree0db5f0fe85af683f5a6b1a97f0b6df44f22f3bd6
parentbbc4d287c9b927dbb475e3e0408a238ec3546128 (diff)
downloadffmpeg-be1d65031fecdce619de8831b7802bfba1932869.tar.gz
mace: check channel count, fixes FPE
Fixes ticket1391 Found-by: Piotr Bandurski <ami_stuff@o2.pl> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 6df1cfa7e4d488051d7b5033c0c69df970db9f82) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-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;