From 79ca312388268b6b0329a8e14857661096b8ca7e Mon Sep 17 00:00:00 2001 From: stan Date: Mon, 8 May 2006 12:46:23 +0000 Subject: [PATCH] Bug 292 - Added more checks on zone polygons. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1966 e3e1d417-86f3-4887-817a-d78f3d33393f --- src/zm_zone.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/zm_zone.cpp b/src/zm_zone.cpp index ffe8b5511..35efc8d1c 100644 --- a/src/zm_zone.cpp +++ b/src/zm_zone.cpp @@ -877,7 +877,10 @@ int Zone::Load( Monitor *monitor, Zone **&zones ) Debug( 5, ( "Parsing polygon %s", Coords )); Polygon polygon; if ( !ParsePolygonString( Coords, polygon ) ) - continue; + Fatal(( "Unable to parse polygon string '%s' for zone %d/%s for monitor %s", Coords, Id, Name, monitor->Name() )); + + if ( polygon.LoX() < 0 || polygon.HiX() >= monitor->Width() || polygon.LoY() < 0 || polygon.HiY() >= monitor->Height() ) + Fatal(( "Zone %d/%s for monitor %s extends outside of image dimensions", Id, Name, monitor->Name() )); if ( false && !strcmp( Units, "Percent" ) ) {