summaryrefslogtreecommitdiff
path: root/libavcodec/aacenc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/aacenc.c')
-rw-r--r--libavcodec/aacenc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 0c921a55d2..61e0f52cc4 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -583,6 +583,7 @@ static int aac_encode_frame(AVCodecContext *avctx,
if (!(avctx->flags & CODEC_FLAG_QSCALE)) {
float ratio = avctx->bit_rate * 1024.0f / avctx->sample_rate / avctx->frame_bits;
s->lambda *= ratio;
+ s->lambda = fminf(s->lambda, 65536.f);
}
if (avctx->frame_bits > 6144*avctx->channels)