mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-25 08:43:16 +00:00
Merge commit '431f57f0467244686ae63a3d06a8cf51f60090ed' into release/2.4
* commit '431f57f0467244686ae63a3d06a8cf51f60090ed': libopusenc: prevent an out-of-bounds read by returning early Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
6feb72a094
@ -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
|
/* FIXME: Opus can handle up to 255 channels. However, the mapping for
|
||||||
* anything greater than 8 is undefined. */
|
* anything greater than 8 is undefined. */
|
||||||
if (avctx->channels > 8)
|
if (avctx->channels > 8) {
|
||||||
av_log(avctx, AV_LOG_WARNING,
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
"Channel layout undefined for %d channels.\n", avctx->channels);
|
"Channel layout undefined for %d channels.\n", avctx->channels);
|
||||||
|
return AVERROR_PATCHWELCOME;
|
||||||
|
}
|
||||||
if (!avctx->bit_rate) {
|
if (!avctx->bit_rate) {
|
||||||
/* Sane default copied from opusenc */
|
/* Sane default copied from opusenc */
|
||||||
avctx->bit_rate = 64000 * opus->stream_count +
|
avctx->bit_rate = 64000 * opus->stream_count +
|
||||||
|
Loading…
Reference in New Issue
Block a user