Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mng_retcode mng_promote_g8_g16 (mng_datap pData)
- {
- ...
- mng_uint16 iW;
- ...
- *pDstline = (mng_uint8)(iW >> 8);
- *(pDstline+1) = (mng_uint8)(iW && 0xFF);
- ...
- }
- This is what should have been written here: *(pDstline+1) = (mng_uint8)(iW & 0xFF);
- This suspicious code was found in LIBMNG project by PVS-Studio static code analyzer.
- Warning message is:
- V560 A part of conditional expression is always true: 0xFF. qmng libmng_pixels.c 14670
- 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