diff options
author | Niklas Kurkisuo <ext-niklas.kurkisuo@nokia.com> | 2011-02-18 08:30:46 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-02-18 08:34:15 (GMT) |
commit | 23f9cec65a76e6aa0675ca426f9e4f6717790dbb (patch) | |
tree | ed63761a377e1617a178a48130153d0f472fead9 | |
parent | 346af37b7bc8d97ae4cc24b0a1cfe9cf4802057b (diff) | |
download | Qt-23f9cec65a76e6aa0675ca426f9e4f6717790dbb.zip Qt-23f9cec65a76e6aa0675ca426f9e4f6717790dbb.tar.gz Qt-23f9cec65a76e6aa0675ca426f9e4f6717790dbb.tar.bz2 |
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>
-rw-r--r-- | src/gui/image/qxpmhandler.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp index a02b3ff..76cd813 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 |