Array overun in opus/silk/arm/NSQ_del_dec_neon_intr.c
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 3.3k
- Forks
- 808
- PR merge metrics
- No merged PRs in 30d
Description
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++ ) {
| ^~~
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in silk/arm/NSQ_del_dec_neon_intr.c, especially the loops around lines 421 and 601, and review the attached opus.patch.gz. Compile the project with gcc 10.2 to reproduce the reported warnings, then verify the affected loops no longer trigger overrun or undefined-behavior diagnostics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- audio-video-rtc
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100