From b885e47b8f757df16fea88ec422a2353da30dfc2 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 12 Mar 2025 13:16:13 -0400 Subject: [PATCH] MT#59962 libisac: fix off-by-one There are only 144 elements in the array. Change-Id: I452aca5ce46e8dce2c321b7409df7720a4f99776 Warned-by: Coverity --- core/plug-in/isac/libisac/entropy_coding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/plug-in/isac/libisac/entropy_coding.c b/core/plug-in/isac/libisac/entropy_coding.c index ad1607f1..88644329 100644 --- a/core/plug-in/isac/libisac/entropy_coding.c +++ b/core/plug-in/isac/libisac/entropy_coding.c @@ -2137,7 +2137,7 @@ int WebRtcIsac_DecodePitchGain(Bitstr *streamdata, WebRtc_Word16 *PitchGains_Q12 *WebRtcIsac_kQPitchGainCdf_ptr = WebRtcIsac_kQPitchGainCdf; err = WebRtcIsac_DecHistBisectMulti(&index_comb, streamdata, WebRtcIsac_kQPitchGainCdf_ptr, WebRtcIsac_kQCdfTableSizeGain, 1); /* error check, Q_mean_Gain.. tables are of size 144 */ - if ((err<0) || (index_comb<0) || (index_comb>144)) + if ((err<0) || (index_comb<0) || (index_comb>=144)) return -ISAC_RANGE_ERROR_DECODE_PITCH_GAIN; /* unquantize back to pitch gains by table look-up */