mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
graphics-server: bounds-check the circle drawing
Otherwise we could overflow the buffer. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
8270283868
commit
0732075869
1 changed files with 3 additions and 0 deletions
|
|
@ -280,6 +280,9 @@ fn line_fill_padded_border(fb: &mut LcdFB, y: usize) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn put_pixel(fb: &mut LcdFB, x: usize, y: usize, color: PixelColor) {
|
fn put_pixel(fb: &mut LcdFB, x: usize, y: usize, color: PixelColor) {
|
||||||
|
if (x >= LCD_PX_PER_LINE) || (y >= LCD_LINES) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if color == PixelColor::Off {
|
if color == PixelColor::Off {
|
||||||
fb[(x + y * LCD_WORDS_PER_LINE * 32) / 32] |= 1 << (x % 32)
|
fb[(x + y * LCD_WORDS_PER_LINE * 32) / 32] |= 1 << (x % 32)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue