1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Merge commit '8dd0a2c5cf40a8a49faae985adc11750b6429132'

* commit '8dd0a2c5cf40a8a49faae985adc11750b6429132':
  libopusenc: prevent an out-of-bounds read by returning early

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-11-13 12:12:16 +01:00
commit 7b824e8b25

View File

@ -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 +