From 5d93de88a8be7e1a77975ae60d6cc2dfd7de64a0 Mon Sep 17 00:00:00 2001 From: Ninni Pipping Date: Fri, 28 Apr 2023 10:50:54 +0200 Subject: Fix size error in `BitMap.opaque_to_polygons` Previous estimate of upper limit on size was incorrect (cherry picked from commit 249784ed53ff8b2b02507d6678dd6aecf511b067) --- 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 204adbcda0..dd20dc1c66 100644 --- a/scene/resources/bit_map.cpp +++ b/scene/resources/bit_map.cpp @@ -354,7 +354,7 @@ Vector> BitMap::_march_square(const Rect2i &p_rect, const Point2 prevx = stepx; prevy = stepy; - ERR_FAIL_COND_V((int)count > width * height, Vector>()); + ERR_FAIL_COND_V((int)count > 2 * (width * height + 1), Vector>()); } while (curx != startx || cury != starty); // Add remaining points to result. -- cgit v1.2.3