[FFmpeg-cvslog] mace: Make sure that the channel count is set to a valid value
Martin Storsjö
git at videolan.org
Tue Sep 17 15:22:27 CEST 2013
ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Mon Sep 16 15:19:52 2013 +0300| [e1f3847f860a1094a46be4c5f10db8df616c3135] | committer: Martin Storsjö
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>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e1f3847f860a1094a46be4c5f10db8df616c3135
---
libavcodec/mace.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/mace.c b/libavcodec/mace.c
index 559dcee..76118e8 100644
--- a/libavcodec/mace.c
+++ b/libavcodec/mace.c
@@ -226,8 +226,8 @@ static void chomp6(ChannelData *chd, int16_t *output, uint8_t val, int tab_idx)
static av_cold int mace_decode_init(AVCodecContext * avctx)
{
- if (avctx->channels > 2)
- return -1;
+ if (avctx->channels > 2 || avctx->channels < 1)
+ return AVERROR(EINVAL);
avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
return 0;
More information about the ffmpeg-cvslog
mailing list