From 6ba3d4243755aac193ad0f8c469b9c6fdca61b78 Mon Sep 17 00:00:00 2001 From: Cimarron Mittelsteadt Date: Wed, 14 Oct 2015 11:29:37 -0700 Subject: [PATCH] BUG: Added check in count_bboxes_overlapping_bbox if bboxes input is empty (any dimension has size 0) --- src/_path.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/_path.h b/src/_path.h index 176db3168304..8bd684a32346 100644 --- a/src/_path.h +++ b/src/_path.h @@ -752,6 +752,10 @@ int count_bboxes_overlapping_bbox(agg::rect_d &a, BBoxArray &bboxes) agg::rect_d b; int count = 0; + // If bboxes is empty return zero + if (bboxes.dim(0) == 0 || bboxes.dim(1) == 0 || bboxes.dim(2) == 0) + return 0; + if (a.x2 < a.x1) { std::swap(a.x1, a.x2); }