Bitmap: Fix crash by attempting to memset -1 bits (UINT64_MAX)

This commit is contained in:
apio 2022-12-07 14:46:11 +01:00
parent 3248041aef
commit 98a55b2c13
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -65,10 +65,11 @@ void Bitmap::clear_region(usize start, usize bits, bool value)
if (!bits) return;
// Set individual bits while not on a byte boundary.
while ((start % 8) && bits--)
while ((start % 8) && bits)
{
set(start, value);
start++;
bits--;
}
// Clear out the rest in bytes.