diff options
author | Ben Bridle <ben@derelict.engineering> | 2024-11-04 13:06:36 +1300 |
---|---|---|
committer | Ben Bridle <ben@derelict.engineering> | 2024-11-04 13:06:41 +1300 |
commit | 81a6b0da7a507214a01dc3a4513d8b73525e4381 (patch) | |
tree | 8238f074246bfcab3b3841f9245021dfa2132ff0 /src/devices/file/buffered_file.rs | |
parent | bfc4e20724471c0a90f823868bcb38d975aee382 (diff) | |
download | bedrock-pc-81a6b0da7a507214a01dc3a4513d8b73525e4381.zip |
Fix issue when drawing textured shapes off-screen
When determining whether or not to draw each pixel of a textured line
or rectangle, the modulo-by-eight operation was being performed on a
signed value, which was returning a negative value when the pixel being
drawn was off-screen. When the negative value was then converted to an
unsigned value, the result was close to usize::MAX, and was causing an
out-of-bounds array access.
To fix this, the value is converted to an unsigned value before taking
the modulo.
Diffstat (limited to 'src/devices/file/buffered_file.rs')
0 files changed, 0 insertions, 0 deletions