aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2005-08-12 12:58:35 +0000
committernyamatongwe <devnull@localhost>2005-08-12 12:58:35 +0000
commit376468d3fe44a546a46044e63af42e0c94483336 (patch)
tree9c83df171138dd8731f81a44826ab36bba8f2611 /src
parent32950e08a4a4905365f4145e02355e8aea5acff9 (diff)
downloadscintilla-mirror-376468d3fe44a546a46044e63af42e0c94483336.tar.gz
Avoid crashes with XPM files that use more than 1 byte per pixel.
Diffstat (limited to 'src')
-rw-r--r--src/XPM.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/XPM.cxx b/src/XPM.cxx
index 3bb23485b..36e7994f4 100644
--- a/src/XPM.cxx
+++ b/src/XPM.cxx
@@ -103,6 +103,11 @@ void XPM::Init(const char * const *linesForm) {
height = atoi(line0);
line0 = NextField(line0);
nColours = atoi(line0);
+ line0 = NextField(line0);
+ if (atoi(line0) != 1) {
+ // Only one char per pixel is supported
+ return;
+ }
codes = new char[nColours];
colours = new ColourPair[nColours];