[FFmpeg-devel] [PATCH 4/4] aacdec_usac: fix off by one error check on channel numbers

Lynne dev at lynne.ee
Mon Jun 3 00:54:29 EEST 2024


---
 libavcodec/aac/aacdec_usac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/aac/aacdec_usac.c b/libavcodec/aac/aacdec_usac.c
index 0d5eb59de5..80c6ab4e65 100644
--- a/libavcodec/aac/aacdec_usac.c
+++ b/libavcodec/aac/aacdec_usac.c
@@ -359,7 +359,7 @@ int ff_aac_usac_config_decode(AACDecContext *ac, AVCodecContext *avctx,
     if (!channel_config_idx) {
         /* UsacChannelConfig() */
         nb_channels = get_escaped_value(gb, 5, 8, 16); /* numOutChannels */
-        if (nb_channels >= 64)
+        if (nb_channels > 64)
             return AVERROR(EINVAL);
 
         av_channel_layout_uninit(&ac->oc[1].ch_layout);
-- 
2.43.0.381.gb435a96ce8


More information about the ffmpeg-devel mailing list