summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorNinni Pipping <over999ships@gmail.com>2023-04-28 10:50:54 +0200
committerRĂ©mi Verschelde <rverschelde@gmail.com>2023-05-12 12:10:50 +0200
commit5d93de88a8be7e1a77975ae60d6cc2dfd7de64a0 (patch)
treeb2c2b3db84b68edc7b256e3791ece033208b88cf /scene/resources
parent813fc0940d40bfc6425b7e29833ca554effcf5dc (diff)
Fix size error in `BitMap.opaque_to_polygons`
Previous estimate of upper limit on size was incorrect (cherry picked from commit 249784ed53ff8b2b02507d6678dd6aecf511b067)
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/bit_map.cpp2
1 files changed, 1 insertions, 1 deletions
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<Vector<Vector2>> BitMap::_march_square(const Rect2i &p_rect, const Point2
prevx = stepx;
prevy = stepy;
- ERR_FAIL_COND_V((int)count > width * height, Vector<Vector<Vector2>>());
+ ERR_FAIL_COND_V((int)count > 2 * (width * height + 1), Vector<Vector<Vector2>>());
} while (curx != startx || cury != starty);
// Add remaining points to result.