From: William King Date: Sat, 25 May 2013 13:41:03 +0000 (-0700) Subject: Small off by one error. If the array is of size 144, then an index of 144 inclusive... X-Git-Tag: v1.2.13~328 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50b664c2dd7c169fefcaccac2c8daf4d4153a4f5;p=thirdparty%2Ffreeswitch.git Small off by one error. If the array is of size 144, then an index of 144 inclusive is an error. --- diff --git a/src/mod/codecs/mod_isac/entropy_coding.c b/src/mod/codecs/mod_isac/entropy_coding.c index a7299447f1..13b6cf7e86 100644 --- a/src/mod/codecs/mod_isac/entropy_coding.c +++ b/src/mod/codecs/mod_isac/entropy_coding.c @@ -2146,7 +2146,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>143)) return -ISAC_RANGE_ERROR_DECODE_PITCH_GAIN; /* unquantize back to pitch gains by table look-up */