Advertisement
PVS-StudioWarnings

PVS-Studio warning V547 for CamStudio

Nov 21st, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. bool CSoundFile::OpenWaveFile()
  2. {
  3.   ....
  4.   DWORD bytesRead = mmioRead(m_hFile, (LPSTR)&m_Format,
  5.                              m_MMCKInfoChild.cksize);
  6.   if (bytesRead < 0)
  7.   {
  8.     AfxMessageBox("Error reading PCM wave format record");
  9.     mmioClose(m_hFile,0);
  10.     m_Mode = FILE_ERROR;
  11.     return FALSE;
  12.   }
  13.   ....
  14. }
  15.  
  16. This suspicious code was found in CamStudio project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V547 Expression 'bytesRead < 0' is always false. Unsigned type value is never < 0. soundfile.cpp 166
  19.  
  20. 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