[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 -2
View File
@@ -504,8 +504,10 @@ BitmapBuffer * BitmapBuffer::loadMaskOnBackground(const char * filename, LcdFlag
BitmapBuffer * mask = BitmapBuffer::loadMask(getThemePath(filename));
if (mask) {
result = new BitmapBuffer(BMP_RGB565, mask->getWidth(), mask->getHeight());
result->clear(background);
result->drawMask(0, 0, mask, foreground);
if (result) {
result->clear(background);
result->drawMask(0, 0, mask, foreground);
}
delete mask;
}
return result;