Skip to content

Commit 98e2351

Browse files
authored
Merge pull request #545 from x3ro/tentative-fix-for-blit-bitmap
Fix overflow in `blit_bitmap`
2 parents 9613a5a + 8098ff6 commit 98e2351

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plotters-backend/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,9 @@ pub trait DrawingBackend: Sized {
308308
break;
309309
}
310310
// FIXME: This assume we have RGB image buffer
311-
let r = src[(dx + dy * w) as usize * 3];
312-
let g = src[(dx + dy * w) as usize * 3 + 1];
313-
let b = src[(dx + dy * w) as usize * 3 + 2];
311+
let r = src[(dx + dy * iw) as usize * 3];
312+
let g = src[(dx + dy * iw) as usize * 3 + 1];
313+
let b = src[(dx + dy * iw) as usize * 3 + 2];
314314
let color = BackendColor {
315315
alpha: 1.0,
316316
rgb: (r, g, b),

0 commit comments

Comments
 (0)