Commit 7b824e8b authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '8dd0a2c5'

* commit '8dd0a2c5':
  libopusenc: prevent an out-of-bounds read by returning early
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 3c6e148e 8dd0a2c5
......@@ -170,10 +170,11 @@ static av_cold int libopus_encode_init(AVCodecContext *avctx)
/* FIXME: Opus can handle up to 255 channels. However, the mapping for
* anything greater than 8 is undefined. */
if (avctx->channels > 8)
av_log(avctx, AV_LOG_WARNING,
if (avctx->channels > 8) {
av_log(avctx, AV_LOG_ERROR,
"Channel layout undefined for %d channels.\n", avctx->channels);
return AVERROR_PATCHWELCOME;
}
if (!avctx->bit_rate) {
/* Sane default copied from opusenc */
avctx->bit_rate = 64000 * opus->stream_count +
......
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