Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static const int kNumPainters = 3;
- static const struct {
- const char* name;
- GPUPainter* painter;
- } painters[] = {
- { "CPU CSC + GPU Render", new CPUColorPainter() },
- { "GPU CSC/Render", new GPUColorWithLuminancePainter() },
- };
- int main(int argc, char** argv) {
- ....
- // Run GPU painter tests.
- for (int i = 0; i < kNumPainters; i++) {
- scoped_ptr<GPUPainter> painter(painters[i].painter);
- ....
- }
- This suspicious code was found in Chromium project by PVS-Studio static code analyzer.
- Warning message is:
- V557 Array overrun is possible. The value of 'i' index could reach 2. shader_bench.cc 152
- 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
Advertisement