BitMask::create Don't request more memory than needed when size is a multiply of 8

(cherry picked from commit 8963be2ef4)
This commit is contained in:
kleonc 2021-05-08 01:19:18 +02:00 committed by Rémi Verschelde
parent 0a4eb472cf
commit 57fdddecff
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -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());
}