qt_imageToWinHBITMAP(): properly delete object on error
Properly delete the handle created by CreateDIBSection() with DeleteObject() in case of error. Pick-to: 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> (cherry picked from commit ce44d63bc3de7e6f95726f943e095c9f34f94365)
This commit is contained in:
parent
ca9b9d6099
commit
e3e3ab5633
@ -305,6 +305,7 @@ HBITMAP qt_imageToWinHBITMAP(const QImage &imageIn, int hbitmapFormat)
|
||||
return nullptr;
|
||||
}
|
||||
if (!pixels) {
|
||||
DeleteObject(bitmap);
|
||||
qErrnoWarning("%s, did not allocate pixel data", __FUNCTION__);
|
||||
return nullptr;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user