PVS-StudioWarnings

PVS-Studio warning V522 for pcsx2

Nov 11th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. void _SPR1interleave() {
  2.   ...
  3.   u32 *ptag;
  4.   ...
  5.   if (ptag == NULL) {                      <<<---
  6.    SysPrintf("SPR1 Tag BUSERR\n");
  7.    spr1->chcr = ( spr1->chcr & 0xFFFF ) |
  8.                 ( (*ptag) & 0xFFFF0000 );  <<<---
  9.    psHu32(DMAC_STAT)|= 1<<15;
  10.    done = 1;
  11.    spr1finished = done;
  12.    return;
  13.   }
  14.   ...
  15. }
  16.  
  17. This suspicious code was found in pcsx2 project by PVS-Studio static code analyzer.
  18. Warning message is:
  19. V522 Dereferencing of the null pointer 'ptag' might take place. pcsx2 spr.cpp 376
  20.  
  21. 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