aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/XPM.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2005-08-12 12:58:35 +0000
committernyamatongwe <unknown>2005-08-12 12:58:35 +0000
commitc70f9c11a197dcb7513f4ad5909913c2aa59eef2 (patch)
tree9c83df171138dd8731f81a44826ab36bba8f2611 /src/XPM.cxx
parentef8fcbaa8a5f087e473200416be39173318e0907 (diff)
downloadscintilla-mirror-c70f9c11a197dcb7513f4ad5909913c2aa59eef2.tar.gz
Avoid crashes with XPM files that use more than 1 byte per pixel.
Diffstat (limited to 'src/XPM.cxx')
-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];