summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qxpmhandler.cpp
diff options
context:
space:
mode:
authorNiklas Kurkisuo <ext-niklas.kurkisuo@nokia.com>2011-02-18 09:30:46 +0100
committerSamuel Rødal <samuel.rodal@nokia.com>2011-02-18 09:34:15 +0100
commit23f9cec65a76e6aa0675ca426f9e4f6717790dbb (patch)
treeed63761a377e1617a178a48130153d0f472fead9 /src/gui/image/qxpmhandler.cpp
parent346af37b7bc8d97ae4cc24b0a1cfe9cf4802057b (diff)
QImage crash when invalid XPM is read.
Add sanity check for cpp, which would otherwise lead to a segfault later in the code. Task-number: QTBUG-17254 Merge-request: 1080 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/gui/image/qxpmhandler.cpp')
-rw-r--r--src/gui/image/qxpmhandler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp
index a02b3ff787..76cd813c94 100644
--- a/src/gui/image/qxpmhandler.cpp
+++ b/src/gui/image/qxpmhandler.cpp
@@ -882,7 +882,7 @@ static bool read_xpm_body(
QByteArray buf(200, 0);
int i;
- if (cpp > 15)
+ if (cpp < 0 || cpp > 15)
return false;
// For > 256 colors, we delay creation of the image until