Fix zmc crashing when zones are no good bby decreasing n_zone before continuing
This commit is contained in:
parent
9681a444b4
commit
6a447194eb
|
@ -990,12 +990,14 @@ int Zone::Load( Monitor *monitor, Zone **&zones )
|
|||
Polygon polygon;
|
||||
if ( !ParsePolygonString( Coords, polygon ) ) {
|
||||
Error( "Unable to parse polygon string '%s' for zone %d/%s for monitor %s, ignoring", Coords, Id, Name, monitor->Name() );
|
||||
n_zones -= 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( polygon.LoX() < 0 || polygon.HiX() >= (int)monitor->Width()
|
||||
|| polygon.LoY() < 0 || polygon.HiY() >= (int)monitor->Height() ) {
|
||||
Error( "Zone %d/%s for monitor %s extends outside of image dimensions, (%d,%d), (%d,%d), ignoring", Id, Name, monitor->Name(), polygon.LoX(), polygon.LoY(), polygon.HiX(), polygon.HiY() );
|
||||
n_zones -= 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue