Fix buffer overrun on out of bounds rectangle height/width

pull/330/head
Mike Bell 2022-03-30 22:23:09 +01:00
rodzic 16bfa467ce
commit a4acf4b94e
1 zmienionych plików z 6 dodań i 0 usunięć

Wyświetl plik

@ -225,6 +225,12 @@ namespace pimoroni {
}
w += _thickness - 1;
h += _thickness - 1;
if (x + w > 296) {
w = 296 - x;
}
if (y + h > 128) {
h = 128 - y;
}
if (h >= 8) {
// Directly write to the frame buffer when clearing a large area