diff options
author | James Almer <jamrial@gmail.com> | 2023-04-13 09:58:25 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2023-04-14 10:04:47 -0300 |
commit | 5cda6b94f45c347805cbd5a0c7ed1d712b5722d7 (patch) | |
tree | ae7dc3d66385b7851bed3aa11376ad8ef7dc6be8 /libavcodec/aacpsy.c | |
parent | 92885f26817b6b2515ac9fd5410c9e8be64bd0c0 (diff) | |
download | ffmpeg-5cda6b94f45c347805cbd5a0c7ed1d712b5722d7.tar.gz |
avcodec/aacpsy: clip global_quality within the psy_vbr_map array boundaries
Fixes ticket #10317.
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/aacpsy.c')
-rw-r--r-- | libavcodec/aacpsy.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c index 4c5ab2c9d5..933369e445 100644 --- a/libavcodec/aacpsy.c +++ b/libavcodec/aacpsy.c @@ -267,7 +267,7 @@ static av_cold void lame_window_init(AacPsyContext *ctx, AVCodecContext *avctx) AacPsyChannel *pch = &ctx->ch[i]; if (avctx->flags & AV_CODEC_FLAG_QSCALE) - pch->attack_threshold = psy_vbr_map[avctx->global_quality / FF_QP2LAMBDA].st_lrm; + pch->attack_threshold = psy_vbr_map[av_clip(avctx->global_quality / FF_QP2LAMBDA, 0, 10)].st_lrm; else pch->attack_threshold = lame_calc_attack_threshold(avctx->bit_rate / avctx->ch_layout.nb_channels / 1000); |