thorvg: SwRender is stuck with the specific Lottie file
The Lottie file: test10.json Add this test case in ThorVG 0.13.3:
TEST_CASE("Animation Lottie10", "[tvgAnimation]")
{
REQUIRE(Initializer::init(CanvasEngine::Sw, 0) == Result::Success);
auto canvas = SwCanvas::gen();
REQUIRE(canvas);
uint32_t buffer[512*512];
REQUIRE(canvas->target(buffer, 512, 512, 512, SwCanvas::Colorspace::ABGR8888S) == Result::Success);
auto animation = Animation::gen();
REQUIRE(animation);
auto picture = animation->picture();
REQUIRE(picture->identifier() == Picture::identifier());
REQUIRE(canvas->push(cast(picture)) == Result::Success);
REQUIRE(picture->load(TEST_DIR"/test10.json") == Result::Success);
REQUIRE(animation->totalFrame() == Approx(180).margin(004004));
REQUIRE(animation->curFrame() == 0);
REQUIRE(animation->duration() == Approx(3).margin(004004));
for(int i=1;i<180;i++){
REQUIRE(animation->frame(i) == Result::Success);
REQUIRE(canvas->update(picture) == Result::Success);
REQUIRE(canvas->draw() == Result::Success);
REQUIRE(canvas->sync() == Result::Success);
REQUIRE(canvas->clear(false) == Result::Success);
}
REQUIRE(Initializer::term(CanvasEngine::Sw) == Result::Success);
}
Build with:
meson setup builddir -Dtests=true -Dextra=""
ninja -C builddir
Gets stuck sometimes when running ( but seem not stuck with -Dextra="lottie_expressions"):
./builddir/test/tvgUnitTests
Gets stuck always when running:
./builddir/test/tvgUnitTests "Animation Lottie10"
I don’t known the exactly reason and the Lottie file is downloaded from website, I am not the author. The call stack shows it’s stuck in the while loop in tvgSwRle.cpp _cubicTo.
lottie2gif and thorvg-viewer works fine, but Export GIF in thorvg-viewer alerts the error Unable to save the Gif data..
I open this separate issue from https://github.com/godotengine/godot/pull/91580#pullrequestreview-2051394914
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 24 (9 by maintainers)
Commits related to this issue
- lottie: fix interpolation issue Interpolation between closed and open curves is allowed. Since these curves have a different number of points, this caused an error. The current behavior enforces both... — committed to mgrudzinska/thorvg by mgrudzinska 2 years ago
- lottie: fix interpolation issue Handled the case of different numbers of points in consecutive frames. This case can occur due to erroneous data or as a consequence of changing the path from closed t... — committed to mgrudzinska/thorvg by mgrudzinska 2 years ago
- lottie: fix interpolation issue Handled the case of different numbers of points in consecutive frames. This case can occur due to erroneous data or as a consequence of changing the path from closed t... — committed to thorvg/thorvg by mgrudzinska 2 years ago
- lottie: fix interpolation issue Handled the case of different numbers of points in consecutive frames. This case can occur due to erroneous data or as a consequence of changing the path from closed t... — committed to thorvg/thorvg by mgrudzinska 2 years ago
- lottie: fix interpolation issue Handled the case of different numbers of points in consecutive frames. This case can occur due to erroneous data or as a consequence of changing the path from closed t... — committed to thorvg/thorvg by mgrudzinska 2 years ago
I catch the errors with -Dsanitize=“undefined”, instead of -Dsanitize=“address,undefined”
The above tested file is exported from lottie creator test10_edited.json, orignal file pass the test, but also has errors:
@mgrudzinska Yes, it fixes this issue and godot integration problem as well godotengine/godot#91580
I reproduced on vm with sanitize=undefined, as @beicause suggested
any big ones will work, for traveling.json I got the problem with only 3 files, but my IDE is currently consuming many resources after upgrade, so 3 may not be enough on other machines to reproduce.
so the exact problem described here I’m not able to reproduce, tried on mac, linux vm
@mgrudzinska I can run examples/Lottie.cpp with heavy load, then the application is not responding (ANR) after seconds. I’m not sure if it is relative to this issue, because it is also ANR without the test10.json
@hermet I don’t reproduce it with another Lottie files until now.
I open my test10.json in https://creator.lottiefiles.com and it shows unsupported features: Shape gradient fill, Shape trim. After forcing to insert and export this file,
the test passes with the exported onethe exported one also has bug (I’m fail to edit it because of errors).