From 85ed63f825da57103c68f73af5adeebf67db0da9 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 26 Jun 2017 16:00:39 +0200 Subject: Fix QWebpHandler::canRead() to take animation frame count into account Task-number: QTBUG-61641 Change-Id: I24a139cc75141a588f2ed2558da85cd2f8391af9 Reviewed-by: Eirik Aavitsland --- src/plugins/imageformats/webp/qwebphandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/plugins/imageformats') diff --git a/src/plugins/imageformats/webp/qwebphandler.cpp b/src/plugins/imageformats/webp/qwebphandler.cpp index 0bd89f6..5a0ae4a 100644 --- a/src/plugins/imageformats/webp/qwebphandler.cpp +++ b/src/plugins/imageformats/webp/qwebphandler.cpp @@ -74,6 +74,10 @@ bool QWebpHandler::canRead() const if (m_scanState != ScanError) { setFormat(QByteArrayLiteral("webp")); + + if (m_features.has_animation && m_iter.frame_num >= m_frameCount) + return false; + return true; } return false; -- cgit v1.2.3