From 9a95b47c96feda8fa5c7973e96efbd54c39a4c8b Mon Sep 17 00:00:00 2001 From: 3djc Date: Sun, 29 Oct 2017 16:28:51 +0100 Subject: [PATCH] Prevent negative values in DMAFillRect (#5308) --- radio/src/gui/480x272/bitmapbuffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/gui/480x272/bitmapbuffer.h b/radio/src/gui/480x272/bitmapbuffer.h index 0d0074137..d4be9dd45 100644 --- a/radio/src/gui/480x272/bitmapbuffer.h +++ b/radio/src/gui/480x272/bitmapbuffer.h @@ -216,7 +216,7 @@ class BitmapBuffer: public BitmapBufferBase if (!data || h==0 || w==0) return; if (h<0) { y+=h; h=-h; } if (w<0) { x+=w; w=-w; } - DMAFillRect(data, width, height, x, y, w, h, lcdColorTable[COLOR_IDX(flags)]); + DMAFillRect(data, width, height, (x>0)?x:0, (y>0)?y:0, w, h, lcdColorTable[COLOR_IDX(flags)]); } void drawFilledRect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t pat, LcdFlags att);