Skip to content
Snippets Groups Projects
Commit e1f3847f authored by Martin Storsjö's avatar Martin Storsjö
Browse files

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@libav.org
Signed-off-by: default avatarMartin Storsjö <martin@martin.st>
parent 1115689d
No related branches found
No related tags found
No related merge requests found
...@@ -226,8 +226,8 @@ static void chomp6(ChannelData *chd, int16_t *output, uint8_t val, int tab_idx) ...@@ -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) static av_cold int mace_decode_init(AVCodecContext * avctx)
{ {
if (avctx->channels > 2) if (avctx->channels > 2 || avctx->channels < 1)
return -1; return AVERROR(EINVAL);
avctx->sample_fmt = AV_SAMPLE_FMT_S16P; avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment