summaryrefslogtreecommitdiff
path: root/libavcodec/mace.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/mace.c')
-rw-r--r--libavcodec/mace.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/mace.c b/libavcodec/mace.c
index 559dcee567..76118e8f2f 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;