Skip to content

Commit

Permalink
Fix: Correct bounds check in set_pixels function for proper out-of-bo…
Browse files Browse the repository at this point in the history
…unds handling
  • Loading branch information
IniterWorker committed Oct 18, 2024
1 parent 9ade843 commit 37445e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mode/graphics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ where
let buffer_len = self.mode.buffer.as_mut().len();

for color in colors {
if buffer_index < buffer_len {
if buffer_index >= buffer_len {
return Err(DisplayError::OutOfBoundsError);
}

Expand Down

0 comments on commit 37445e3

Please sign in to comment.