Add safeguards for drawText() & drawSizedText()

This commit is contained in:
Raphael Coeffic
2021-05-30 17:27:48 +02:00
parent ff35b89543
commit 8692796dd5
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -908,6 +908,7 @@ uint8_t BitmapBuffer::drawChar(coord_t x, coord_t y, const uint8_t * font, const
coord_t BitmapBuffer::drawSizedText(coord_t x, coord_t y, const char * s, uint8_t len, LcdFlags flags)
{
if (!s) return (flags & VERTICAL) ? y : x;
MOVE_OFFSET();
int height = getFontHeight(flags);
+1
View File
@@ -311,6 +311,7 @@ class BitmapBuffer: public BitmapBufferBase<pixel_t>
coord_t drawText(coord_t x, coord_t y, const char * s, LcdFlags flags = 0)
{
if (!s) return (flags & VERTICAL) ? y : x;
return drawSizedText(x, y, s, 255, flags);
}