Skip to content

Commit 7dd77a4

Browse files
committed
Fix unaligned write in bitmap backend.
1 parent 3137913 commit 7dd77a4

File tree

1 file changed

+3
-3
lines changed
  • plotters-bitmap/src/bitmap_pixel

1 file changed

+3
-3
lines changed

plotters-bitmap/src/bitmap_pixel/rgb.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ impl PixelFormat for RGBPixel {
212212
b, r, g, b, r, g, b, r, // QW2
213213
g, b, r, g, b, r, g, b, // QW3
214214
]);
215-
*ptr = d1;
216-
*ptr.offset(1) = d2;
217-
*ptr.offset(2) = d3;
215+
ptr.write_unaligned(d1);
216+
ptr.offset(1).write_unaligned(d2);
217+
ptr.offset(2).write_unaligned(d3);
218218
}
219219
}
220220

0 commit comments

Comments
 (0)