QImage::setAlphaChannel(): Check result of image conversion
alphaChannel.convertToFormat() may fail due to OOM. Check the obtained image. Task-number: QTBUG-54873 Change-Id: I778b7de7de611105fe23c1c24cbd69bd8f7c72d9 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This commit is contained in:
parent
49926bb9ef
commit
5123dba564
@ -4233,6 +4233,8 @@ void QImage::setAlphaChannel(const QImage &alphaChannel)
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
const QImage sourceImage = alphaChannel.convertToFormat(QImage::Format_RGB32);
|
const QImage sourceImage = alphaChannel.convertToFormat(QImage::Format_RGB32);
|
||||||
|
if (sourceImage.isNull())
|
||||||
|
return;
|
||||||
const uchar *src_data = sourceImage.d->data;
|
const uchar *src_data = sourceImage.d->data;
|
||||||
uchar *dest_data = d->data;
|
uchar *dest_data = d->data;
|
||||||
for (int y=0; y<h; ++y) {
|
for (int y=0; y<h; ++y) {
|
||||||
|
Loading…
Reference in New Issue
Block a user