From 48347499c23e69b200a597473447f80050d77287 Mon Sep 17 00:00:00 2001 From: Ninni Pipping Date: Fri, 28 Apr 2023 11:45:08 +0200 Subject: [PATCH] Fix size error in `BitMap.opaque_to_polygons` Previous estimate of upper limit on size was incorrect --- scene/resources/bit_map.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/resources/bit_map.cpp b/scene/resources/bit_map.cpp index 358d3324c7..400736f0d4 100644 --- a/scene/resources/bit_map.cpp +++ b/scene/resources/bit_map.cpp @@ -318,7 +318,7 @@ Vector BitMap::_march_square(const Rect2i &rect, const Point2i &start) prevx = stepx; prevy = stepy; - ERR_FAIL_COND_V((int)count > width * height, _points); + ERR_FAIL_COND_V((int)count > 2 * (width * height + 1), _points); } while (curx != startx || cury != starty); return _points; }