Skip to content

Commit 8098ff6

Browse files
committed
Fix overflow in blit_bitmap
1 parent 9613a5a commit 8098ff6

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)