lottie_loader: return false for frameRate = 0

Loading a png file without giving a mimetype, resulted
in an error from the lottie loader.
This commit is contained in:
Mira Grudzinska 2023-08-15 11:10:51 +02:00 committed by Hermet Park
parent 15c09f260f
commit 5bafdcbfa3

View file

@ -182,6 +182,11 @@ bool LottieLoader::header()
++p; ++p;
} }
if (frameRate < FLT_EPSILON) {
TVGLOG("LOTTIE", "Not a Lottie file? Frame rate is 0!");
return false;
}
frameDuration = (endFrame - startFrame) / frameRate; frameDuration = (endFrame - startFrame) / frameRate;
TVGLOG("LOTTIE", "info: frame rate = %d, duration = %f size = %d x %d", frameRate, frameDuration, (int)w, (int)h); TVGLOG("LOTTIE", "info: frame rate = %d, duration = %f size = %d x %d", frameRate, frameDuration, (int)w, (int)h);