avcodec/utils: report insane channel count errors

More than 64 is not *that* insane, so let's report the error at least.

Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
Marton Balint 2018-07-03 12:09:13 +02:00
parent 85bfcc46d1
commit 5982078e8d
1 changed files with 1 additions and 0 deletions

View File

@ -674,6 +674,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
av_freep(&avctx->subtitle_header);
if (avctx->channels > FF_SANE_NB_CHANNELS) {
av_log(avctx, AV_LOG_ERROR, "Too many channels: %d\n", avctx->channels);
ret = AVERROR(EINVAL);
goto free_and_end;
}