Add out-of-memory checks to QImage
author Pauli Jarvinen
committer Pasi Pentikäinen
commit 3280fef791c408e7bff49bbe91898a01bcdeb452
tree 501cd5251561abf8ad65f2e180cdcd104fea6fce
parent 67ed6f452cdb0b08cbf07c41971d67bbe8a365a4
Add out-of-memory checks to QImage

Some of the methods of QImage crashed on out-of-memory situation as
they referred to null pointer if creation of a new QImage instance had
failed. Many cases like this were already fixed by commit
a041e4eca3467c1baa6245b6fb47def127f30f41 which was a fix for
QTBUG-1985, but few cases still remained. Now, all the lines creating a
new QImage instance in qimage.cpp have been gone through and sanity
checks have been added where it was necessary to avoid immediate

Task-number: ou1cimx1#994957
Change-Id: I1f07e8890bc91de18af075be73b1a06c667f3776
Reviewed-by: Murray Read <>
Reviewed-by: Pasi Pentikäinen <>
(cherry picked from commit 35aff3e7adf6235dd69bcb8cbc5a03947aded863)