From 8963be2ef47920cd0c2cd21bfac8d1b83f5c4bdb Mon Sep 17 00:00:00 2001 From: kleonc <9283098+kleonc@users.noreply.github.com> Date: Sat, 8 May 2021 01:19:18 +0200 Subject: [PATCH] BitMask::create Don't request more memory than needed when size is a multiply of 8 --- 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 e9bfac36538..0ffeb8a5bf9 100644 --- a/scene/resources/bit_map.cpp +++ b/scene/resources/bit_map.cpp @@ -38,7 +38,7 @@ void BitMap::create(const Size2 &p_size) { width = p_size.width; height = p_size.height; - bitmask.resize(((width * height) / 8) + 1); + bitmask.resize((((width * height) - 1) / 8) + 1); memset(bitmask.ptrw(), 0, bitmask.size()); }