Don't use libpng allocated buffer to store ICC profile data
The data becomes invalid by the next PNG read or write. Fixes: QTBUG-81671 Change-Id: I738f5c2abbeebf2c9080d64fef7e66cc082afe89 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>bb10
parent
f24b247961
commit
49b158e07d
|
|
@ -606,7 +606,7 @@ bool QPngHandlerPrivate::readPngHeader()
|
|||
#endif
|
||||
png_uint_32 profLen;
|
||||
png_get_iCCP(png_ptr, info_ptr, &name, &compressionType, &profileData, &profLen);
|
||||
colorSpace = QColorSpace::fromIccProfile(QByteArray::fromRawData((const char *)profileData, profLen));
|
||||
colorSpace = QColorSpace::fromIccProfile(QByteArray((const char *)profileData, profLen));
|
||||
if (!colorSpace.isValid()) {
|
||||
qWarning() << "QPngHandler: Failed to parse ICC profile";
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue