diff --git a/scene/resources/bit_map.cpp b/scene/resources/bit_map.cpp index 358d3324c75..400736f0d45 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; }