summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTORS4
-rw-r--r--HISTORY3
-rw-r--r--osd.c4
3 files changed, 10 insertions, 1 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index b2a94540..f748f6fd 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -2127,3 +2127,7 @@ Patrice Staudt <staudt@engsystem.net>
Tobias Bratfisch <tobias@reel-multimedia.com>
for improving numdigits(), isnumber() and strreplace()
for suggesting to make skipspace() an inline function
+
+Andreas Mair <andreas@vdr-developer.org>
+ for suggesting to make cBitmap::SetXpm() checks whether the given Xpm pointer is
+ not NULL
diff --git a/HISTORY b/HISTORY
index 9aae28c4..c8ff1e7a 100644
--- a/HISTORY
+++ b/HISTORY
@@ -5340,3 +5340,6 @@ Video Disk Recorder Revision History
Ville Skyttä). Plugin authors may want to consider doing the same.
- Fixed the link to the GPL2 at http://www.gnu.org in vdr.c (thanks to Ville
Skyttä).
+- cBitmap::SetXpm() now checks whether the given Xpm pointer is not NULL, to
+ avoid a crash with files that only contain "/* XPM */" (suggested by Andreas
+ Mair).
diff --git a/osd.c b/osd.c
index ec7f9a3c..013ef8b7 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 1.71 2007/07/20 14:51:36 kls Exp $
+ * $Id: osd.c 1.72 2007/08/12 11:33:17 kls Exp $
*/
#include "osd.h"
@@ -321,6 +321,8 @@ bool cBitmap::LoadXpm(const char *FileName)
bool cBitmap::SetXpm(const char *const Xpm[], bool IgnoreNone)
{
+ if (!Xpm)
+ return false;
const char *const *p = Xpm;
int w, h, n, c;
if (4 != sscanf(*p, "%d %d %d %d", &w, &h, &n, &c)) {