mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-06-03 17:08:08 -04:00
Fix crash with malformed files
oss-fuzz/29284
This commit is contained in:
parent
c72c9f577b
commit
8ad43638ad
@ -109,6 +109,9 @@ bool ANIHandler::read(QImage *outImage)
|
||||
if (!m_imageSequence.isEmpty()) {
|
||||
if (m_currentImageNumber < m_imageSequence.count()) {
|
||||
const int nextFrame = m_imageSequence.at(m_currentImageNumber);
|
||||
if (nextFrame < 0 || nextFrame >= m_frameOffsets.count()) {
|
||||
return false;
|
||||
}
|
||||
const auto nextOffset = m_frameOffsets.at(nextFrame);
|
||||
device()->seek(nextOffset);
|
||||
} else if (m_currentImageNumber == m_imageSequence.count()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user