diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2021-05-17 17:39:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-17 17:39:24 +0200 |
commit | 8e8cad5bc964418bf8e156e830fae82102bc2988 (patch) | |
tree | 9877dac0c81af29055287e41fc9e4e352e62c34e | |
parent | b3e3f0e34c1df4820f023142722902fa1110fe85 (diff) | |
parent | 8963be2ef47920cd0c2cd21bfac8d1b83f5c4bdb (diff) |
Merge pull request #48549 from kleonc/bitmap_resize_fix
BitMask::create Don't request more memory than needed when size is a multiply of 8
-rw-r--r-- | scene/resources/bit_map.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/resources/bit_map.cpp b/scene/resources/bit_map.cpp index e9bfac3653..0ffeb8a5bf 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()); } |