Opened 5 years ago

Last modified 5 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


[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++){


for(; (((x86_reg)&dst[i]) & 0x1F) && i<w_r; i++){

Change History (1)

comment:1 by jkqxz, 5 years ago

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.)

Note: See TracTickets for help on using tickets.