[FFmpeg-cvslog] mace: check channel count, fixes FPE
Michael Niedermayer
git at videolan.org
Thu Jun 7 01:44:22 CEST 2012
ffmpeg | branch: release/0.11 | Michael Niedermayer <michaelni at gmx.at> | Sun Jun 3 14:53:43 2012 +0200| [be1d65031fecdce619de8831b7802bfba1932869] | 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>
(cherry picked from commit 6df1cfa7e4d488051d7b5033c0c69df970db9f82)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=be1d65031fecdce619de8831b7802bfba1932869
---
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