summaryrefslogtreecommitdiff
path: root/osd.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2007-02-24 18:00:00 +0100
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2007-02-24 18:00:00 +0100
commitb144f230a74e9cfdb131e1f20a104522f28d76f0 (patch)
tree99e5d9b991262a64bcc780d2dd180e3145890add /osd.c
parent3f26d6dd96745dcdbaed98ce6ac764594e3495d3 (diff)
downloadvdr-patch-lnbsharing-b144f230a74e9cfdb131e1f20a104522f28d76f0.tar.gz
vdr-patch-lnbsharing-b144f230a74e9cfdb131e1f20a104522f28d76f0.tar.bz2
Version 1.4.5-2vdr-1.4.5-2
- Removed 'assert(0)' from cDvbSpuDecoder::setTime() (thanks to Marco Schlüßler). - Fixed a possible crash when loading an invalid XPM file (thanks to Martin Wache). - Updated satellite names in 'sources.conf' (thanks to Thilo Wunderlich). - Fixed handling error status in cDvbTuner::GetFrontendStatus() (thanks to Reinhard Nissl).
Diffstat (limited to 'osd.c')
-rw-r--r--osd.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/osd.c b/osd.c
index bf9640c..64f475d 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.67 2006/02/26 14:31:31 kls Exp $
+ * $Id: osd.c 1.68 2007/02/17 16:05:52 kls Exp $
*/
#include "osd.h"
@@ -218,14 +218,17 @@ bool cBitmap::LoadXpm(const char *FileName)
int w, h, n, c;
if (4 != sscanf(s, "%d %d %d %d", &w, &h, &n, &c)) {
esyslog("ERROR: faulty 'values' line in XPM file '%s'", FileName);
+ isXpm = false;
break;
}
lines = h + n + 1;
Xpm = MALLOC(char *, lines);
+ memset(Xpm, 0, lines * sizeof(char*));
}
char *q = strchr(s, '"');
if (!q) {
esyslog("ERROR: missing quotes in XPM file '%s'", FileName);
+ isXpm = false;
break;
}
*q = 0;
@@ -233,16 +236,21 @@ bool cBitmap::LoadXpm(const char *FileName)
Xpm[index++] = strdup(s);
else {
esyslog("ERROR: too many lines in XPM file '%s'", FileName);
+ isXpm = false;
break;
}
}
}
- if (index == lines)
- Result = SetXpm(Xpm);
- else
- esyslog("ERROR: too few lines in XPM file '%s'", FileName);
- for (int i = 0; i < index; i++)
- free(Xpm[i]);
+ if (isXpm) {
+ if (index == lines)
+ Result = SetXpm(Xpm);
+ else
+ esyslog("ERROR: too few lines in XPM file '%s'", FileName);
+ }
+ if (Xpm) {
+ for (int i = 0; i < index; i++)
+ free(Xpm[i]);
+ }
free(Xpm);
fclose(f);
}