Opened 22 months ago

Last modified 22 months 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 Changed 22 months ago by jkqxz

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.