[FFmpeg-cvslog] mace: check channel count, fixes FPE
Michael Niedermayer
git at videolan.org
Sun Jun 3 15:02:04 CEST 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jun 3 14:53:43 2012 +0200| [6df1cfa7e4d488051d7b5033c0c69df970db9f82] | committer: Michael Niedermayer
mace: check channel count, fixes FPE
Fixes ticket1391
Found-by: Piotr Bandurski <ami_stuff at o2.pl>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6df1cfa7e4d488051d7b5033c0c69df970db9f82
---
libavcodec/mace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/mace.c b/libavcodec/mace.c
index bf9ea08..dd721d2 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;
More information about the ffmpeg-cvslog
mailing list