From 435f329cef640cacf325c7218eb1a63d4576bab5 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 15 Feb 2015 13:01:57 -0800 Subject: [PATCH] fix agg::conv_clip_polygon validation --- benchmark/test_polygon_clipping.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/benchmark/test_polygon_clipping.cpp b/benchmark/test_polygon_clipping.cpp index 60687c056..9a3ec2942 100644 --- a/benchmark/test_polygon_clipping.cpp +++ b/benchmark/test_polygon_clipping.cpp @@ -93,6 +93,7 @@ public: extent_.maxy()); unsigned cmd; double x,y; + clipped.rewind(0); mapnik::geometry_type geom2(mapnik::geometry_type::types::Polygon); while ((cmd = clipped.vertex(&x, &y)) != mapnik::SEG_END) { geom2.push_vertex(x,y,(mapnik::CommandType)cmd); @@ -130,6 +131,10 @@ public: extent_.maxy()); unsigned cmd; double x,y; + // NOTE: this rewind is critical otherwise + // agg_conv_adapter_vpgen will give garbage + // values for the first vertex + clipped.rewind(0); while ((cmd = clipped.vertex(&x, &y)) != mapnik::SEG_END) { count++; }