[FFmpeg-cvslog] mace: Make sure that the channel count is set to a valid value
Martin Storsjö
git at videolan.org
Thu Jan 16 21:57:38 CET 2014
ffmpeg | branch: release/0.10 | Martin Storsjö <martin at martin.st> | Mon Sep 16 15:19:52 2013 +0300| [48f27c854f23b43890f72239c5d18b7fff0707af] | committer: Luca Barbato
mace: Make sure that the channel count is set to a valid value
Also return a proper error code.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>
(cherry picked from commit e1f3847f860a1094a46be4c5f10db8df616c3135)
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
Conflicts:
libavcodec/mace.c
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=48f27c854f23b43890f72239c5d18b7fff0707af
---
libavcodec/mace.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/mace.c b/libavcodec/mace.c
index 792d71d..d02b1dc 100644
--- a/libavcodec/mace.c
+++ b/libavcodec/mace.c
@@ -231,8 +231,8 @@ static av_cold int mace_decode_init(AVCodecContext * avctx)
{
MACEContext *ctx = avctx->priv_data;
- if (avctx->channels > 2)
- return -1;
+ if (avctx->channels > 2 || avctx->channels < 1)
+ return AVERROR(EINVAL);
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
avcodec_get_frame_defaults(&ctx->frame);
More information about the ffmpeg-cvslog
mailing list