Skip to content

Commit

Permalink
Merge pull request #545 from x3ro/tentative-fix-for-blit-bitmap
Browse files Browse the repository at this point in the history
Fix overflow in `blit_bitmap`
  • Loading branch information
AaronErhardt committed Feb 8, 2024
2 parents 9613a5a + 8098ff6 commit 98e2351
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plotters-backend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,9 @@ pub trait DrawingBackend: Sized {
break;
}
// FIXME: This assume we have RGB image buffer
let r = src[(dx + dy * w) as usize * 3];
let g = src[(dx + dy * w) as usize * 3 + 1];
let b = src[(dx + dy * w) as usize * 3 + 2];
let r = src[(dx + dy * iw) as usize * 3];
let g = src[(dx + dy * iw) as usize * 3 + 1];
let b = src[(dx + dy * iw) as usize * 3 + 2];
let color = BackendColor {
alpha: 1.0,
rgb: (r, g, b),
Expand Down

0 comments on commit 98e2351

Please sign in to comment.