diff options
author | Jason Barron <jbarron@trolltech.com> | 2009-08-14 13:13:56 (GMT) |
---|---|---|
committer | Jason Barron <jbarron@trolltech.com> | 2009-08-14 13:13:56 (GMT) |
commit | 8ea7bc92650e8e4c74e5ec2bbf05ef2b33107ee8 (patch) | |
tree | 9b2b9f071a498100fd31f0b818a5f1b71c364b98 /src | |
parent | 53f08a35f50f41fe0151b0f1f8334332120b8826 (diff) | |
download | Qt-8ea7bc92650e8e4c74e5ec2bbf05ef2b33107ee8.zip Qt-8ea7bc92650e8e4c74e5ec2bbf05ef2b33107ee8.tar.gz Qt-8ea7bc92650e8e4c74e5ec2bbf05ef2b33107ee8.tar.bz2 |
Fix incorrect logic in QPixmap::fromSymbianCFbsBitmap.
In some alternate universes it might make sense to use a pointer before
checking if it is valid, but since this isn't one we shoudn't do
it. Also extend the autotest a little to make sure we catch this case.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/image/qpixmap_s60.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index 58b3ee4..ab19924 100644 --- a/src/gui/image/qpixmap_s60.cpp +++ b/src/gui/image/qpixmap_s60.cpp @@ -202,10 +202,13 @@ return a null QPixmap. QPixmap QPixmap::fromSymbianCFbsBitmap(CFbsBitmap *bitmap) { + if (!bitmap) + return QPixmap(); + int width = bitmap->SizeInPixels().iWidth; int height = bitmap->SizeInPixels().iHeight; - if (!bitmap || width <= 0 || height <= 0 || bitmap->IsCompressedInRAM()) + if (width <= 0 || height <= 0 || bitmap->IsCompressedInRAM()) return QPixmap(); TDisplayMode displayMode = bitmap->DisplayMode(); |