Opened 6 years ago
Last modified 6 years ago
#6744 new defect
libavcodec/x86/snowdsp.c: 2 * array index sanity check in odd place ?
Reported by: | dcb | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avcodec |
Version: | unspecified | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
[ffmpeg-3.4/libavcodec/x86/snowdsp.c:152]: (style) Array index 'i' is used before limits check.
[ffmpeg-3.4/libavcodec/x86/snowdsp.c:79]: (style) Array index 'i' is used before limits check.
Source code is
for(; (((x86_reg)&temp[i]) & 0x1F) && i<w_r; i++){
and
for(; (((x86_reg)&dst[i]) & 0x1F) && i<w_r; i++){
Note:
See TracTickets
for help on using tickets.
Looks correct to me? The conditions are in that order because in nondegenerate cases it is always the first one which terminates the loop. (You can only hit the second condition with tiny width.)