PVS-StudioWarnings

PVS-Studio warning V547 for VirtualBox

Nov 11th, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. VBoxVHWAImage::reset(VHWACommandList * pCmdList)
  2. {
  3.   ....
  4.   if (pCmd->SurfInfo.PixelFormat.c.rgbBitCount != 32
  5.    || pCmd->SurfInfo.PixelFormat.c.rgbBitCount != 24)
  6.   {
  7.     AssertFailed();
  8.     pCmd->u.out.ErrInfo = -1;
  9.     return VINF_SUCCESS;
  10.   }
  11.   ....
  12. }
  13.  
  14. This suspicious code was found in VirtualBox project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V547 Expression is always true. Probably the '&&' operator should be used here. vboxfboverlay.cpp 2259
  17.  
  18. 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