Merge pull request #1049 from pimoroni/patch-pixel-span

PicoGraphics: Fix overflow bug in p4 pixel span.
pull/1051/head
Philip Howard 2025-01-15 09:01:45 +00:00 zatwierdzone przez GitHub
commit d014b289d6
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -70,6 +70,10 @@ namespace pimoroni {
}
void PicoGraphics_PenP4::set_pixel_span(const Point &p, uint l) {
// prevent a zero length span causing an overflow in 'l'
// and trying to write 2GB of pixels.
if (l == 0) {return;}
auto i = (p.x + p.y * bounds.w);
// pointer to byte in framebuffer that contains this pixel