#6443 Cast maxscale from double to float for scale calculation.
authorBob Paulin <bob@apache.org>
Thu, 21 Apr 2016 12:47:13 +0000 (07:47 -0500)
committerBob Paulin <bob@apache.org>
Thu, 21 Apr 2016 12:47:13 +0000 (07:47 -0500)
apps/createsamples/utility.cpp

index ddcc1eb..cf2bdeb 100644 (file)
@@ -1372,7 +1372,7 @@ void cvCreateTestSamples( const char* infoname,
 
                 if( maxscale < 1.0F ) continue;
 
-                scale = (maxscale - 1.0F) * rand() / RAND_MAX + 1.0F;
+                scale = ((float)maxscale - 1.0F) * rand() / RAND_MAX + 1.0F;
 
                 width = (int) (scale * winwidth);
                 height = (int) (scale * winheight);