Opened 7 years ago

Closed 5 years ago

#6746 closed defect (invalid)

libpostproc/postprocess.c: 2 * array index sanity check in odd place ?

Reported by: dcb Owned by:
Priority: normal Component: postproc
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

[ffmpeg-3.4/libpostproc/postprocess.c:804]: (style) Array index 'o' is used before limits check.
[ffmpeg-3.4/libpostproc/postprocess.c:818]: (style) Array index 'o' is used before limits check.

Source code is

for(o=0; options[o] && o<2; o++){

and

for(o=0; options[o] && o<1; o++){

Change History (2)

comment:1 by Hendrik, 7 years ago

The array is NULL terminated, the first condition will stop the loop before anything bad happens, so the order doesn't really make any difference. It just limits the number of loop executions.

comment:2 by Elon Musk, 5 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.