qt_imageToWinHBITMAP(): properly delete object on error
Properly delete the handle created by CreateDIBSection() with DeleteObject() in case of error. Pick-to: 6.6 6.5 Fixes: QTBUG-18057 Change-Id: Ibf40f6afb255bc5a7d7bf39939f5eb3dfcd19f84 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit b37b8eb7ea0a809c6e96189e8f9e834d6763e170) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
30e0dc908c
commit
ce44d63bc3
@ -305,6 +305,7 @@ HBITMAP qt_imageToWinHBITMAP(const QImage &imageIn, int hbitmapFormat)
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
if (!pixels) {
|
if (!pixels) {
|
||||||
|
DeleteObject(bitmap);
|
||||||
qErrnoWarning("%s, did not allocate pixel data", __FUNCTION__);
|
qErrnoWarning("%s, did not allocate pixel data", __FUNCTION__);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user