Also return a proper error code.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
static av_cold int mace_decode_init(AVCodecContext * avctx)
{
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;
avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
return 0;