Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void RB_CalcColorFromOneMinusEntity(unsigned char *dstColors) {
- ...
- unsigned char invModulate[3];
- ...
- invModulate[0] = 255 - backEnd.currentEntity->e.shaderRGBA[0];
- invModulate[1] = 255 - backEnd.currentEntity->e.shaderRGBA[1];
- invModulate[2] = 255 - backEnd.currentEntity->e.shaderRGBA[2];
- // this trashes alpha, but the AGEN block fixes it
- invModulate[3] = 255 - backEnd.currentEntity->e.shaderRGBA[3];
- ...
- }
- The same error can be found in Quake 3.
- This suspicious code was found in Wolf project by PVS-Studio static code analyzer.
- Warning message is:
- V557 Array overrun is possible. The '3' index is pointing beyond array bound. renderer tr_shade_calc.c 679
- 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