From 6a447194ebf441546e0708682f8f494d781bbc14 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 16 Mar 2017 10:55:13 -0400 Subject: [PATCH] Fix zmc crashing when zones are no good bby decreasing n_zone before continuing --- src/zm_zone.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/zm_zone.cpp b/src/zm_zone.cpp index 90ba855dc..d2e36488f 100644 --- a/src/zm_zone.cpp +++ b/src/zm_zone.cpp @@ -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; }