Heic: accept also the msf1 header suffix

Add support for this rare variant of the heic header magic bytes.

Prior to Qt 6.7.2, such files would often be successfully read in
spite of being rejected by the heic handler's canRead(), as a side
effect of a bug in the macjp2 handler.

Fixes: QTBUG-127965
Change-Id: Icb790bc72c1eefaf42580b5ab1b358d3efdf0ecc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 929698e7f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 3158a940d0)
This commit is contained in:
Eirik Aavitsland 2024-09-06 17:20:54 +02:00 committed by Qt Cherry-pick Bot
parent ebdf5742f0
commit 321566cf1c
1 changed files with 1 additions and 0 deletions

View File

@ -23,6 +23,7 @@ bool QMacHeifHandler::canRead(QIODevice *iod)
bCanRead = (!qstrncmp(buf + 4, "ftyp", 4) &&
(!qstrncmp(buf + 8, "heic", 4) ||
!qstrncmp(buf + 8, "heix", 4) ||
!qstrncmp(buf + 8, "msf1", 4) ||
!qstrncmp(buf + 8, "mif1", 4)));
}
return bCanRead;