PVS-StudioWarnings

PVS-Studio warning V560 for libmng

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