Opened 7 years ago
Closed 3 years ago
#6754 closed defect (fixed)
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 (last modified by )
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 (12)
comment:1 by , 7 years ago
comment:2 by , 7 years ago
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.
follow-up: 6 comment:5 by , 5 years ago
Description: | modified (diff) |
---|
follow-up: 7 comment:6 by , 5 years ago
Replying to cehoyos:
Suspecious? Really? Now it never become 0, so mode is never checked. "Result of operator '|' is always true if one operand is non-zero." And == have higher precedence. In this case STATUS_BEGIN_REACHED is 2. So...
follow-up: 8 comment:7 by , 5 years ago
comment:8 by , 5 years ago
follow-up: 10 comment:9 by , 5 years ago
Now I have two questions:
Why do you believe I disagree?
Why didn't you sent a patch made with git format-patch
to the development mailing list?
comment:10 by , 5 years ago
Replying to cehoyos:
Now I have two questions:
Why do you believe I disagree?
Why didn't you sent a patch made withgit format-patch
to the development mailing list?
Well, because it is already midnight here?
comment:11 by , 3 years ago
Patch is here: https://patchwork.ffmpeg.org/project/ffmpeg/patch/20210524010024.4928-1-val.zapod.vz@gmail.com/
Wow, your mailing list is also buggy, sometimes it processes patches in real time and sometimes not! WTF. P.S. sorry for a duplication too, I send that twice, it is not a bug.
comment:12 by , 3 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
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?