Opened 6 years ago

Closed 5 years ago

#12443 closed Patch - Bug Fix (fixed)

Patch: proposed bugfix for static analysis detected error

Reported by: Gary Buhrmaster <gary.buhrmaster@…> Owned by: JYA
Priority: minor Milestone: unknown
Component: MythTV - Video Decoding Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no


Clang 3.5 reported the following warning:

vaapicontext.cpp:673:9: warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses]
    if (!m_dispType == kVADisplayX11)
        ^           ~~
vaapicontext.cpp:673:9: note: add parentheses after the '!' to evaluate the comparison first
    if (!m_dispType == kVADisplayX11)
         (                          )
vaapicontext.cpp:673:9: note: add parentheses around left hand side expression to silence this warning
    if (!m_dispType == kVADisplayX11)
        (          )

Since m_dispType is not a bitfield (but an enum) negating it before the comparison seems unintended.

Proposed (and completely untested) patch will be attached, but appears consistent with the other code fragments in the source.

Note that the returned value after the comparison seems to be irrelevant, since the only apparent place this routine is called (almost immediately) checks for m_dispType != kVADisplayX11 anyway.

Attachments (1)

vaapicontext.patch (447 bytes) - added by Gary Buhrmaster <gary.buhrmaster@…> 6 years ago.

Download all attachments as: .zip

Change History (2)

Changed 6 years ago by Gary Buhrmaster <gary.buhrmaster@…>

Attachment: vaapicontext.patch added


comment:1 Changed 5 years ago by Karl Dietz <dekarl@…>

Resolution: fixed
Status: newclosed

In 0a7d238f5a22ea114598e8364ef5b65b63e3696e/mythtv:

silence static analysis error

Patch by Gary Buhrmaster

Fixes #12443

Note: See TracTickets for help on using tickets.