Opened 5 weeks ago

Last modified 5 weeks ago

#6754 new defect

libavfilter/signature_lookup.c:494: suspicious compare ?

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

Description

ffmpeg-3.4/libavfilter/signature_lookup.c:494]: (warning) Result of operator '|' is always true if one operand is non-zero. Did you intend to use '&'?

Source code is

if (meandist < minmeandist
status == STATUS_END_REACHED | STATUS_BEGIN_REACHED

mode == MODE_FAST){

maybe better code

if (meandist < minmeandist
status == (STATUS_END_REACHED | STATUS_BEGIN_REACHED)

mode == MODE_FAST){

Change History (2)

comment:1 Changed 5 weeks ago by cehoyos

Please send your patches made with git format-patch to the FFmpeg development mailing list, patches (and patch suggestions) are ignored here.

How did you find the issues?

comment:2 Changed 5 weeks ago by dcb

How did you find the issues?

A static analyser called cppcheck, available from sourceforge.

I find it very useful for C and C++ development. It catches
a lot of problems compilers don't find.

Note: See TracTickets for help on using tickets.