Avoid assert on nonsense input

Fixes oss-fuzz 69439. Credit to OSS-Fuzz for finding the case.

Change-Id: I5211900073377c7bdccb904dbc6ff172419e76f1
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
(cherry picked from commit 913cc91c0abb8087a85984930049f208965b05c9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Allan Sandfeld Jensen 2024-06-21 13:40:37 +02:00 committed by Qt Cherry-pick Bot
parent aabaf64c25
commit 9dcedc184c

View File

@ -1935,7 +1935,7 @@ bool fromIccProfile(const QByteArray &data, QColorSpace *colorSpace)
QColorSpacePrivate *colorspaceDPtr = QColorSpacePrivate::get(*colorSpace);
colorspaceDPtr->isPcsLab = (header.pcs == uint(Tag::Lab_));
if (tagIndex.contains(Tag::cicp)) {
if (tagIndex.contains(Tag::cicp) && header.inputColorSpace == uint(ColorSpaceType::Rgb)) {
// Let cicp override nLut profiles if we fully recognize it.
if (parseCicp(data, tagIndex[Tag::cicp], colorspaceDPtr))
threeComponentMatrix = true;