Browse Source

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: Martin Storsjö <martin@martin.st>
tags/n2.1
Martin Storsjö 12 years ago
parent
commit
e1f3847f86
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavcodec/mace.c

+ 2
- 2
libavcodec/mace.c View File

@@ -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;


Loading…
Cancel
Save