From 321566cf1c3db27ae501aad0d422bc8b1cb6ea2e Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Fri, 6 Sep 2024 17:20:54 +0200 Subject: [PATCH] Heic: accept also the msf1 header suffix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø (cherry picked from commit 929698e7f307e5d94ab7fd50cfac38662dec3200) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit 3158a940d0cb854cb54f071146a33639cdf314ec) --- src/plugins/imageformats/macheif/qmacheifhandler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/imageformats/macheif/qmacheifhandler.cpp b/src/plugins/imageformats/macheif/qmacheifhandler.cpp index 36e074f5..87b13ba7 100644 --- a/src/plugins/imageformats/macheif/qmacheifhandler.cpp +++ b/src/plugins/imageformats/macheif/qmacheifhandler.cpp @@ -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;