Invalidate old QImage data if load()/loadFromData() has failed
authorKonstantin Ritt <ritt.ks@gmail.com>
Mon, 8 Oct 2012 13:40:13 +0000 (16:40 +0300)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 10 Oct 2012 11:24:23 +0000 (13:24 +0200)
commit008e5ba61a68846ad29c65a2fe10b8c19c74f6eb
tree59f1bc75adb09b41b862de4145924368529ef95d
parent34c31cd74cde7a1c36f3603a625fb0d28c259a6e
Invalidate old QImage data if load()/loadFromData() has failed

This guarantees one will never get `!img.isNull()` after
load()/loadFromData() has failed, even if the image was
not null before.
Apply the same fix to QPixmap and QPicture.

Change-Id: Ida1ad6a6f0fc830df8e75ada0c163fc2d3360dea
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
dist/changes-5.0.0
src/gui/image/qimage.cpp
src/gui/image/qpicture.cpp
src/gui/image/qpixmap.cpp
tests/auto/gui/image/qimage/tst_qimage.cpp
tests/auto/gui/image/qpixmap/tst_qpixmap.cpp