opus icon indicating copy to clipboard operation
opus copied to clipboard

Array overun in opus/silk/arm/NSQ_del_dec_neon_intr.c

Open Baudouin0 opened this issue 3 years ago • 0 comments

gcc version 10.2 reports an overrun during compile:

silk/arm/NSQ_del_dec_neon_intr.c: In function ‘silk_NSQ_del_dec_neon’: silk/arm/NSQ_del_dec_neon_intr.c:422:55: warning: iteration 80 invokes undefined behavior []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Waggressive-loop-optimizations-Waggressive-loop-optimizations]8;;] 422 | NSQ->sLPC_Q14[ i ] = psDelDec->sLPC_Q14[ i ][ Winner_ind ]; | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ silk/arm/NSQ_del_dec_neon_intr.c:421:9: note: within this loop 421 | for( ; i < NSQ_LPC_BUF_LENGTH; i++ ) { | ^~~ In file included from ./silk/main.h:31, from silk/arm/NSQ_del_dec_neon_intr.c:36: silk/arm/NSQ_del_dec_neon_intr.c:602:48: warning: iteration 2147483647 invokes undefined behavior []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Waggressive-loop-optimizations-Waggressive-loop-optimizations]8;;] 602 | AR_shp_Q28[i] = silk_LSHIFT32( AR_shp_Q13[i], 15 ); | ^ ./silk/SigProc_FIX.h:503:73: note: in definition of macro ‘silk_LSHIFT32’ 503 | #define silk_LSHIFT32(a, shift) ((opus_int32)((opus_uint32)(a)<<(shift))) /* shift >= 0, shift < 32 */ | ^ silk/arm/NSQ_del_dec_neon_intr.c:601:5: note: within this loop 601 | for( ; i < MAX_SHAPE_LPC_ORDER; i++ ) { | ^~~

opus.patch.gz

Baudouin0 avatar Aug 25 '21 13:08 Baudouin0