PVS-StudioWarnings

PVS-Studio warning V560 for LIBMNG

Nov 12th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. mng_retcode mng_promote_g8_g16 (mng_datap pData)
  2. {
  3.   ...
  4.   mng_uint16 iW;
  5.   ...
  6.   *pDstline     = (mng_uint8)(iW >> 8);
  7.   *(pDstline+1) = (mng_uint8)(iW && 0xFF);
  8.   ...
  9. }
  10.  
  11. This is what should have been written here: *(pDstline+1) = (mng_uint8)(iW & 0xFF);
  12.  
  13.  
  14. This suspicious code was found in LIBMNG project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V560 A part of conditional expression is always true: 0xFF. qmng libmng_pixels.c 14670
  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