summaryrefslogtreecommitdiff
path: root/src/devices/clock.rs
diff options
context:
space:
mode:
authorBen Bridle <ben@derelict.engineering>2024-11-04 13:06:36 +1300
committerBen Bridle <ben@derelict.engineering>2024-11-04 13:06:41 +1300
commit81a6b0da7a507214a01dc3a4513d8b73525e4381 (patch)
tree8238f074246bfcab3b3841f9245021dfa2132ff0 /src/devices/clock.rs
parentbfc4e20724471c0a90f823868bcb38d975aee382 (diff)
downloadbedrock-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/clock.rs')
0 files changed, 0 insertions, 0 deletions