Commit 59c915a4 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/wavpackenc: Check the number of channels

They are stored in a byte, thus more than 255 is not possible
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 26757b02
......@@ -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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment