diff --git a/libavcodec/on2avc.c b/libavcodec/on2avc.c index deaa2b4c04b547d9a9e6b37d2ff3c6e81937f30b..c00339f7b0fdace26ee88a0710b3582ac43b1d15 100644 --- a/libavcodec/on2avc.c +++ b/libavcodec/on2avc.c @@ -918,6 +918,10 @@ static av_cold int on2avc_decode_init(AVCodecContext *avctx) av_log(avctx, AV_LOG_ERROR, "0x500 version should be mono\n"); return AVERROR_INVALIDDATA; } + if (avctx->channels > 2) { + av_log(avctx, AV_LOG_ERROR, "Only 1 or 2 channels are supported.\n"); + return AVERROR(EINVAL); + } if (avctx->channels == 2) av_log(avctx, AV_LOG_WARNING, "Stereo mode support is not good, patch is welcome\n");