[Horus] Malloc check added

This commit is contained in:
Bertrand Songis
2017-01-22 22:01:39 +01:00
parent cdb3f48da7
commit d60de4466a
7 changed files with 50 additions and 23 deletions
+4 -3
View File
@@ -94,9 +94,10 @@ BitmapBuffer * createFontCache(const uint8_t * font, LcdFlags fg, LcdFlags bg)
coord_t height = *(((uint16_t *)font)+1);
BitmapBuffer * buffer = new BitmapBuffer(BMP_RGB565, width, height);
buffer->clear(bg);
buffer->drawBitmapPattern(0, 0, font, fg);
if (buffer) {
buffer->clear(bg);
buffer->drawBitmapPattern(0, 0, font, fg);
}
return buffer;
}