mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2026-11-01 00:48:49 -04:00
Update to the OSS-Fuzz test to verify all animations
This commit is contained in:
committed by
Mirco Miranda
parent
487b51ae9c
commit
98d616eb16
@@ -131,20 +131,33 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
|||||||
is_animated = handler->option(QImageIOHandler::Animation).toBool();
|
is_animated = handler->option(QImageIOHandler::Animation).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_animated) { // animated image
|
int tryCrash = 2;
|
||||||
if (handler->supportsOption(QImageIOHandler::Size)) {
|
int maxCount = handler->imageCount() + tryCrash;
|
||||||
|
for (int j = 0; tryCrash && j < maxCount; ++j) {
|
||||||
|
if (is_animated && handler->supportsOption(QImageIOHandler::Size)) {
|
||||||
handler->option(QImageIOHandler::Size).toSize();
|
handler->option(QImageIOHandler::Size).toSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
handler->imageCount();
|
handler->imageCount();
|
||||||
handler->loopCount();
|
handler->loopCount();
|
||||||
handler->read(&i);
|
|
||||||
handler->nextImageDelay();
|
handler->nextImageDelay();
|
||||||
handler->currentImageNumber();
|
if (!handler->read(&i)) {
|
||||||
handler->jumpToImage(0);
|
--tryCrash;
|
||||||
handler->jumpToNextImage();
|
}
|
||||||
} else { // static image
|
}
|
||||||
|
|
||||||
|
tryCrash = 2;
|
||||||
|
for (int j = 0; tryCrash && j < maxCount; ++j) {
|
||||||
|
if (is_animated && handler->supportsOption(QImageIOHandler::Size)) {
|
||||||
|
handler->option(QImageIOHandler::Size).toSize();
|
||||||
|
}
|
||||||
handler->read(&i);
|
handler->read(&i);
|
||||||
|
handler->imageCount();
|
||||||
|
handler->loopCount();
|
||||||
|
handler->nextImageDelay();
|
||||||
|
if (!handler->jumpToImage(j)) {
|
||||||
|
--tryCrash;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete handler;
|
delete handler;
|
||||||
|
|||||||
Reference in New Issue
Block a user