summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2010-01-28 15:34:21 (GMT)
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2010-01-28 16:12:17 (GMT)
commit0585997b7dbe25ece9f60684171c16206d10d65f (patch)
treef88a21dc79ba8621d635722d0e1b7e826b1d3d68 /src/plugins
parent06ee48f7ad7f5ab8bdbaed765d301fa2c0b417fb (diff)
downloadQt-0585997b7dbe25ece9f60684171c16206d10d65f.zip
Qt-0585997b7dbe25ece9f60684171c16206d10d65f.tar.gz
Qt-0585997b7dbe25ece9f60684171c16206d10d65f.tar.bz2
Fix a regression: icons with slightly wrong ICO header did not load.
Regression was introduced by commit fd9cdaa55da455b90eacec571aeb2c84fa55f7e0. Also fix a completely broken autotest that didn't actually test anything. Task-number: QTBUG-7688 Reviewed-by: Alexis
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/imageformats/ico/qicohandler.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/imageformats/ico/qicohandler.cpp b/src/plugins/imageformats/ico/qicohandler.cpp
index 4f49476..b2351fa 100644
--- a/src/plugins/imageformats/ico/qicohandler.cpp
+++ b/src/plugins/imageformats/ico/qicohandler.cpp
@@ -556,7 +556,11 @@ QImage ICOReader::iconAt(int index)
else // # colors used
icoAttrib.ncolors = header.biClrUsed ? header.biClrUsed : 1 << icoAttrib.nbits;
icoAttrib.w = iconEntry.bWidth;
+ if (icoAttrib.w == 0)
+ icoAttrib.w = header.biWidth;
icoAttrib.h = iconEntry.bHeight;
+ if (icoAttrib.h == 0)
+ icoAttrib.h = header.biHeight/2;
QImage::Format format = QImage::Format_ARGB32;
if (icoAttrib.nbits == 24)