diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2012-03-03 13:25:22 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2012-03-03 13:25:22 +0100 |
commit | 78c1fee7f891e9e10cd7b617ef920b6df34d0d1f (patch) | |
tree | 4c8ecfb8cbd5d7c19f9717acf2387ea1ce5b12dc /osd.c | |
parent | 0432198e0b3fb7f77711a2ccb832cdc6c092df58 (diff) | |
download | vdr-78c1fee7f891e9e10cd7b617ef920b6df34d0d1f.tar.gz vdr-78c1fee7f891e9e10cd7b617ef920b6df34d0d1f.tar.bz2 |
Now checking for NULL in cOsd::AddPixmap()
Diffstat (limited to 'osd.c')
-rw-r--r-- | osd.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: osd.c 2.25 2012/03/02 10:48:19 kls Exp $ + * $Id: osd.c 2.26 2012/03/03 13:20:15 kls Exp $ */ #include "osd.h" @@ -1701,11 +1701,13 @@ void cOsd::DestroyPixmap(cPixmap *Pixmap) cPixmap *cOsd::AddPixmap(cPixmap *Pixmap) { - LOCK_PIXMAPS; - if (numPixmaps < MAXOSDPIXMAPS) - return pixmaps[numPixmaps++] = Pixmap; - else - esyslog("ERROR: too many OSD pixmaps requested (maximum is %d)", MAXOSDPIXMAPS); + if (Pixmap) { + LOCK_PIXMAPS; + if (numPixmaps < MAXOSDPIXMAPS) + return pixmaps[numPixmaps++] = Pixmap; + else + esyslog("ERROR: too many OSD pixmaps requested (maximum is %d)", MAXOSDPIXMAPS); + } return NULL; } |