diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-01-11 18:58:08 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-01-15 16:00:31 +0100 |
commit | 858f43043f74278cb8f4f9967a1177348a528ca0 (patch) | |
tree | 69f8c0c2bd84996fa7bb94c3a949777ce1afd3cb | |
parent | d0fd9bec1f8d7055c5036935d9a8d3a8e4a69566 (diff) | |
download | ffmpeg-858f43043f74278cb8f4f9967a1177348a528ca0.tar.gz |
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 59c915a403af32c4ff5126625b0cc7e38f4beff9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/wavpackenc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c index b387b360d0..0798fc5d68 100644 --- a/libavcodec/wavpackenc.c +++ b/libavcodec/wavpackenc.c @@ -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)) |