PVS-StudioWarnings

PVS-Studio warning V547 for OpenCV

Nov 13th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. void CvFuzzyMeanShiftTracker::SearchWindow::initDepthValues(....)
  2. {
  3.   unsigned int d=0, mind = 0xFFFF, maxd = 0,
  4.            m0 = 0, m1 = 0, mc, dd;
  5.   ....
  6.   for (int j = 0; j < height; j++)
  7.   {
  8.     ....
  9.     if (d > maxd)
  10.       maxd = d;
  11.     ....
  12.   }
  13. }
  14.  
  15. Variable 'd' does not change in the loop.
  16.  
  17. This suspicious code was found in OpenCV project by PVS-Studio static code analyzer.
  18. Warning message is:
  19. V547 Expression 'd > maxd' is always false. Unsigned type value is never < 0. fuzzymeanshifttracker.cpp 386
  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