Avoid potential divide by zero in footprint spreading PVS V609
(cherry picked from commit 8588bea4b2
)
This commit is contained in:
parent
b2c99dd953
commit
be958e3fdb
|
@ -297,12 +297,12 @@ void SpreadFootprints( std::vector<FOOTPRINT*>* aFootprints, wxPoint aSpreadArea
|
|||
{
|
||||
int Xsize_allowed = (int) ( sqrt( placementsurface ) * 4.0 / 3.0 );
|
||||
|
||||
if( Xsize_allowed < 0 || Xsize_allowed > INT_MAX/2 )
|
||||
if( Xsize_allowed <= 0 || Xsize_allowed > INT_MAX/2 )
|
||||
Xsize_allowed = INT_MAX/2;
|
||||
|
||||
int Ysize_allowed = (int) ( placementsurface / Xsize_allowed );
|
||||
|
||||
if( Ysize_allowed < 0 || Ysize_allowed > INT_MAX/2 )
|
||||
if( Ysize_allowed <= 0 || Ysize_allowed > INT_MAX/2 )
|
||||
Ysize_allowed = INT_MAX/2;
|
||||
|
||||
CRectPlacement placementArea;
|
||||
|
|
Loading…
Reference in New Issue