Fix bug w/large GFXcanvas1's (use 32-bit byte counts)

This commit is contained in:
Phillip Burgess 2023-01-18 14:53:07 -08:00
parent e122c3d20f
commit 5ea4be3ffe
2 changed files with 3 additions and 3 deletions

View File

@ -1761,7 +1761,7 @@ const uint8_t PROGMEM GFXcanvas1::GFXclrBit[] = {0x7F, 0xBF, 0xDF, 0xEF,
*/
/**************************************************************************/
GFXcanvas1::GFXcanvas1(uint16_t w, uint16_t h) : Adafruit_GFX(w, h) {
uint16_t bytes = ((w + 7) / 8) * h;
uint32_t bytes = ((w + 7) / 8) * h;
if ((buffer = (uint8_t *)malloc(bytes))) {
memset(buffer, 0, bytes);
}
@ -1887,7 +1887,7 @@ bool GFXcanvas1::getRawPixel(int16_t x, int16_t y) const {
/**************************************************************************/
void GFXcanvas1::fillScreen(uint16_t color) {
if (buffer) {
uint16_t bytes = ((WIDTH + 7) / 8) * HEIGHT;
uint32_t bytes = ((WIDTH + 7) / 8) * HEIGHT;
memset(buffer, color ? 0xFF : 0x00, bytes);
}
}

View File

@ -1,5 +1,5 @@
name=Adafruit GFX Library
version=1.11.4
version=1.11.5
author=Adafruit
maintainer=Adafruit <info@adafruit.com>
sentence=Adafruit GFX graphics core library, this is the 'core' class that all our other graphics libraries derive from.