mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
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:
parent
15c09f260f
commit
5bafdcbfa3
1 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||||
|
|
Loading…
Add table
Reference in a new issue