diff options
| author | Jochen Dolze <vdr@dolze.de> | 2010-11-12 17:22:13 +0100 |
|---|---|---|
| committer | Jochen Dolze <vdr@dolze.de> | 2010-11-12 17:22:13 +0100 |
| commit | e2b8dc50f54ce91a6c5c26a4b5c798fd94b488e3 (patch) | |
| tree | 8c60e111d365f057e566776a7e8e4afc8239c171 /gfxtools.cpp | |
| parent | 94dd6f768ab19fa3af4ff2a9b72a6c18951e7601 (diff) | |
| download | vdr-plugin-tvonscreen-e2b8dc50f54ce91a6c5c26a4b5c798fd94b488e3.tar.gz vdr-plugin-tvonscreen-e2b8dc50f54ce91a6c5c26a4b5c798fd94b488e3.tar.bz2 | |
Dropped XLFont option, code cleanup
Diffstat (limited to 'gfxtools.cpp')
| -rw-r--r-- | gfxtools.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gfxtools.cpp b/gfxtools.cpp index d76ef3a..ef53b7a 100644 --- a/gfxtools.cpp +++ b/gfxtools.cpp @@ -97,7 +97,8 @@ bool DrawXpm(char *Xpm[], areaT *drawable,int x0,int y0,winhandleT winhand,bool } int NoneColorIndex = MAXNUMCOLORS; - tColor cols[n]; + tColor *cols = new tColor[n]; + if (!cols) return false; for (int i = 0; i < n; i++) { @@ -105,12 +106,14 @@ bool DrawXpm(char *Xpm[], areaT *drawable,int x0,int y0,winhandleT winhand,bool if (int(strlen(s)) < c) { esyslog("ERROR: faulty 'colors' line in XPM: '%s'", s); + delete [] cols; return false; } s = skipspace(s + c); if (*s != 'c') { esyslog("ERROR: unknown color key in XPM: '%c'", *s); + delete [] cols; return false; } s = skipspace(s + 1); @@ -122,6 +125,7 @@ bool DrawXpm(char *Xpm[], areaT *drawable,int x0,int y0,winhandleT winhand,bool if (*s != '#') { esyslog("ERROR: unknown color code in XPM: '%c'", *s); + delete [] cols; return false; } unsigned int col=strtoul(++s, NULL, 16); @@ -143,6 +147,7 @@ bool DrawXpm(char *Xpm[], areaT *drawable,int x0,int y0,winhandleT winhand,bool if (int(strlen(s)) != w * c) { esyslog("ERROR: faulty pixel line in XPM: %d '%s'", y, s); + delete [] cols; return false; } for (int x = 0; x < w; x++) @@ -161,5 +166,6 @@ bool DrawXpm(char *Xpm[], areaT *drawable,int x0,int y0,winhandleT winhand,bool s += c; } } + delete [] cols; return true; } |
