Browse Source

avcodec/wavpackenc: Check the number of channels

They are stored in a byte, thus more than 255 is not possible

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 59c915a403)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n2.4.13
Michael Niedermayer 10 years ago
parent
commit
250e5cb71d
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavcodec/wavpackenc.c

+ 5
- 0
libavcodec/wavpackenc.c View File

@@ -128,6 +128,11 @@ static av_cold int wavpack_encode_init(AVCodecContext *avctx)

s->avctx = avctx;

if (avctx->channels > 255) {
av_log(avctx, AV_LOG_ERROR, "Too many channels\n", avctx->channels);
return AVERROR(EINVAL);
}

if (!avctx->frame_size) {
int block_samples;
if (!(avctx->sample_rate & 1))


Loading…
Cancel
Save