Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct SPCXHeader {
- ...
- u8 Palette[48];
- u8 Reserved;
- u8 Planes;
- u16 BytesPerLine;
- ...
- }
- IImage* CImageLoaderPCX::loadImage(io::IReadFile* file) const
- {
- ...
- for( s32 i=0; i<256; i++ )
- {
- paletteData[i] = (header.Palette[i*3+0] << 16) |
- (header.Palette[i*3+1] << 8) |
- (header.Palette[i*3+2]);
- }
- ...
- }
- This suspicious code was found in irrlicht project by PVS-Studio static code analyzer.
- Warning message is:
- V557 Array overrun is possible. The value of 'i * 3 + 0' index could reach 765. Irrlicht cimageloaderpcx.cpp 113
- 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