Advertisement
PVS-StudioWarnings

PVS-Studio warning V567 for IPP Samples

Nov 21st, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. bool MoveOnNextFrame()
  2. {
  3.   if (m_nFrames>0)
  4.   {
  5.     m_pFrame[m_curIndex] = 0;
  6.     m_curIndex = (++m_curIndex)%m_maxN;
  7.     m_nFrames--;
  8.     return true;
  9.   }
  10.   return false;
  11. }
  12.  
  13. This suspicious code was found in IPP Samples project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V567 Undefined behavior. The 'm_curIndex' variable is modified while being used twice between sequence points. vc1_enc umc_vc1_enc_planes.h 630
  16.  
  17. 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