From c70f9c11a197dcb7513f4ad5909913c2aa59eef2 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Fri, 12 Aug 2005 12:58:35 +0000 Subject: Avoid crashes with XPM files that use more than 1 byte per pixel. --- src/XPM.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') 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]; -- cgit v1.2.3