Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- STDMETHODIMP QEnumPins::QueryInterface(const IID &iid,void **out)
- {
- ...
- if (S_OK)
- AddRef();
- return hr;
- }
- It works on a sheer luck. S_OK is 0, by the way. That is, we don't perform AddRef().
- This is what should have been written here: if (hr == S_OK).
- This suspicious code was found in QT project by PVS-Studio static code analyzer.
- Warning message is:
- V545 Such conditional expression of 'if' operator is incorrect for the HRESULT type value '(HRESULT) 0L'. The SUCCEEDED or FAILED macro should be used instead. phonon_ds9 qbasefilter.cpp 60
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement