From 350ce1b990460cb2178f369f22fe80803f5645f3 Mon Sep 17 00:00:00 2001 From: Fushan Wen Date: Sat, 15 Oct 2022 11:40:41 +0800 Subject: [PATCH] avif: return `false` in `canRead()` when `imageIndex >= imageCount` Otherwise when `cache: false` is set in AnimatedImage, QMovie will try to read the image forever. BUG: 460085 FIXED-IN: 5.100 --- src/imageformats/avif.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/imageformats/avif.cpp b/src/imageformats/avif.cpp index 2865a4e..c4f7a0f 100644 --- a/src/imageformats/avif.cpp +++ b/src/imageformats/avif.cpp @@ -42,6 +42,11 @@ bool QAVIFHandler::canRead() const if (m_parseState != ParseAvifError) { setFormat("avif"); + + if (m_parseState == ParseAvifSuccess && m_decoder->imageIndex >= m_decoder->imageCount - 1) { + return false; + } + return true; } return false; -- GitLab