summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2015-03-25 08:57:05 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2015-03-25 08:57:05 +0100
commit909e6c6249939e61e27a039b04da5ea296191cbe (patch)
tree72a8878c27ed5f468bc50af28eb1bb9c7f9f94b9
parent62596f991ebf30a61cdbe1de15acd2c63f598149 (diff)
downloadvdr-909e6c6249939e61e27a039b04da5ea296191cbe.tar.gz
vdr-909e6c6249939e61e27a039b04da5ea296191cbe.tar.bz2
Fixed a crash in cOsd::SetAreas() in case CreatePixmap() returns NULL
-rw-r--r--osd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/osd.c b/osd.c
index 79ed5447..579c54db 100644
--- a/osd.c
+++ b/osd.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: osd.c 4.1 2015/03/08 13:54:47 kls Exp $
+ * $Id: osd.c 4.2 2015/03/25 08:57:05 kls Exp $
*/
#include "osd.h"
@@ -1842,7 +1842,10 @@ eOsdError cOsd::SetAreas(const tArea *Areas, int NumAreas)
width = Areas[0].x2 - Areas[0].x1 + 1;
height = Areas[0].y2 - Areas[0].y1 + 1;
cPixmap *Pixmap = CreatePixmap(0, cRect(Areas[0].x1, Areas[0].y1, width, height));
- Pixmap->Clear();
+ if (Pixmap)
+ Pixmap->Clear();
+ else
+ Result = oeOutOfMemory;
bitmaps[numBitmaps++] = new cBitmap(10, 10, 8); // dummy bitmap for GetBitmap()
}
else {