shithub: opus

Download patch

ref: 10b2978de398fa4e27357638aa15466cab326028
parent: 928dcffd98f422fc2ed34966a2bd1d4b0505a14f
author: Jean-Marc Valin <[email protected]>
date: Fri Aug 5 13:15:14 EDT 2016

Making it clearer to Coverity that nStates cannot exceed NLSF_QUANT_DEL_DEC_STATES

--- a/silk/NLSF_del_dec_quant.c
+++ b/silk/NLSF_del_dec_quant.c
@@ -131,7 +131,7 @@
             RD_Q25[ j + nStates ] = silk_SMLABB( silk_MLA( RD_tmp_Q25, silk_SMULBB( diff_Q10, diff_Q10 ), w_Q5[ i ] ), mu_Q20, rate1_Q5 );
         }
 
-        if( nStates < NLSF_QUANT_DEL_DEC_STATES ) {
+        if( silk_LSHIFT( nStates, 1 ) <= NLSF_QUANT_DEL_DEC_STATES ) {
             /* double number of states and copy */
             for( j = 0; j < nStates; j++ ) {
                 ind[ j + nStates ][ i ] = ind[ j ][ i ] + 1;