You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did some fuzzing and found six interesting JSONs that cause to crashes or undefined behaviour. It would be great to have them fixed.
Case 1
Valgrid noticed usage of uninitialized values.
001f.json {"v":"0","op":9,"layers":[{"ddd":0,"ks":{"r":{"k":[{"i":{},"":0}]}},"op":1}]}
Click to see output (valgrind ...)
mymedia@barberry:~/rlottie$ valgrind --track-origins=yes build/example/lottie2gif fuzz/collect/001f.json
==1821184== Memcheck, a memory error detector
==1821184== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==1821184== Using Valgrind-3.17.0 and LibVEX; rerun with -h for copyright info
==1821184== Command: build/example/lottie2gif fuzz/collect/001f.json
==1821184==
==1821184== Conditional jump or move depends on uninitialised value(s)
==1821184== at 0x4899F2F: VMatrix::rotate(float, VMatrix::Axis) (vmatrix.cpp:240)
==1821184== by 0x48C968F: rlottie::internal::model::Transform::Data::matrix(int, bool) const (lottiemodel.cpp:197)
==1821184== by 0x48AE69D: rlottie::internal::model::Transform::matrix(int, bool) const (lottiemodel.h:618)
==1821184== by 0x48AE918: rlottie::internal::model::Layer::matrix(int) const (lottiemodel.h:700)
==1821184== by 0x48A7C3D: rlottie::internal::renderer::Layer::matrix(int) const (lottieitem.cpp:440)
==1821184== by 0x48A79D9: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:404)
==1821184== by 0x48A8DF4: rlottie::internal::renderer::CompLayer::updateContent() (lottieitem.cpp:653)
==1821184== by 0x48A7B60: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:430)
==1821184== by 0x48A62F1: rlottie::internal::renderer::Composition::update(int, VSize const&, bool) (lottieitem.cpp:146)
==1821184== by 0x48F6E79: AnimationImpl::update(unsigned long, VSize const&, bool) (lottieanimation.cpp:105)
==1821184== by 0x48F6F90: AnimationImpl::render(unsigned long, rlottie::Surface const&, bool) (lottieanimation.cpp:118)
==1821184== by 0x48F7AF3: rlottie::Animation::renderSync(unsigned long, rlottie::Surface, bool) (lottieanimation.cpp:371)
==1821184== Uninitialised value was created by a stack allocation
==1821184== at 0x48E41FA: void LottieParserImpl::parseKeyFrame<float, void>(rlottie::internal::model::KeyFrames<float, void>&) (lottieparser.cpp:2010)
==1821184==
==1821184== Conditional jump or move depends on uninitialised value(s)
==1821184== at 0x4899F3C: VMatrix::rotate(float, VMatrix::Axis) (vmatrix.cpp:240)
==1821184== by 0x48C968F: rlottie::internal::model::Transform::Data::matrix(int, bool) const (lottiemodel.cpp:197)
==1821184== by 0x48AE69D: rlottie::internal::model::Transform::matrix(int, bool) const (lottiemodel.h:618)
==1821184== by 0x48AE918: rlottie::internal::model::Layer::matrix(int) const (lottiemodel.h:700)
==1821184== by 0x48A7C3D: rlottie::internal::renderer::Layer::matrix(int) const (lottieitem.cpp:440)
==1821184== by 0x48A79D9: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:404)
==1821184== by 0x48A8DF4: rlottie::internal::renderer::CompLayer::updateContent() (lottieitem.cpp:653)
==1821184== by 0x48A7B60: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:430)
==1821184== by 0x48A62F1: rlottie::internal::renderer::Composition::update(int, VSize const&, bool) (lottieitem.cpp:146)
==1821184== by 0x48F6E79: AnimationImpl::update(unsigned long, VSize const&, bool) (lottieanimation.cpp:105)
==1821184== by 0x48F6F90: AnimationImpl::render(unsigned long, rlottie::Surface const&, bool) (lottieanimation.cpp:118)
==1821184== by 0x48F7AF3: rlottie::Animation::renderSync(unsigned long, rlottie::Surface, bool) (lottieanimation.cpp:371)
==1821184== Uninitialised value was created by a stack allocation
==1821184== at 0x48E41FA: void LottieParserImpl::parseKeyFrame<float, void>(rlottie::internal::model::KeyFrames<float, void>&) (lottieparser.cpp:2010)
==1821184==
==1821184== Conditional jump or move depends on uninitialised value(s)
==1821184== at 0x4899F71: VMatrix::rotate(float, VMatrix::Axis) (vmatrix.cpp:244)
==1821184== by 0x48C968F: rlottie::internal::model::Transform::Data::matrix(int, bool) const (lottiemodel.cpp:197)
==1821184== by 0x48AE69D: rlottie::internal::model::Transform::matrix(int, bool) const (lottiemodel.h:618)
==1821184== by 0x48AE918: rlottie::internal::model::Layer::matrix(int) const (lottiemodel.h:700)
==1821184== by 0x48A7C3D: rlottie::internal::renderer::Layer::matrix(int) const (lottieitem.cpp:440)
==1821184== by 0x48A79D9: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:404)
==1821184== by 0x48A8DF4: rlottie::internal::renderer::CompLayer::updateContent() (lottieitem.cpp:653)
==1821184== by 0x48A7B60: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:430)
==1821184== by 0x48A62F1: rlottie::internal::renderer::Composition::update(int, VSize const&, bool) (lottieitem.cpp:146)
==1821184== by 0x48F6E79: AnimationImpl::update(unsigned long, VSize const&, bool) (lottieanimation.cpp:105)
==1821184== by 0x48F6F90: AnimationImpl::render(unsigned long, rlottie::Surface const&, bool) (lottieanimation.cpp:118)
==1821184== by 0x48F7AF3: rlottie::Animation::renderSync(unsigned long, rlottie::Surface, bool) (lottieanimation.cpp:371)
==1821184== Uninitialised value was created by a stack allocation
==1821184== at 0x48E41FA: void LottieParserImpl::parseKeyFrame<float, void>(rlottie::internal::model::KeyFrames<float, void>&) (lottieparser.cpp:2010)
==1821184==
==1821184== Conditional jump or move depends on uninitialised value(s)
==1821184== at 0x4899F82: VMatrix::rotate(float, VMatrix::Axis) (vmatrix.cpp:244)
==1821184== by 0x48C968F: rlottie::internal::model::Transform::Data::matrix(int, bool) const (lottiemodel.cpp:197)
==1821184== by 0x48AE69D: rlottie::internal::model::Transform::matrix(int, bool) const (lottiemodel.h:618)
==1821184== by 0x48AE918: rlottie::internal::model::Layer::matrix(int) const (lottiemodel.h:700)
==1821184== by 0x48A7C3D: rlottie::internal::renderer::Layer::matrix(int) const (lottieitem.cpp:440)
==1821184== by 0x48A79D9: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:404)
==1821184== by 0x48A8DF4: rlottie::internal::renderer::CompLayer::updateContent() (lottieitem.cpp:653)
==1821184== by 0x48A7B60: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:430)
==1821184== by 0x48A62F1: rlottie::internal::renderer::Composition::update(int, VSize const&, bool) (lottieitem.cpp:146)
==1821184== by 0x48F6E79: AnimationImpl::update(unsigned long, VSize const&, bool) (lottieanimation.cpp:105)
==1821184== by 0x48F6F90: AnimationImpl::render(unsigned long, rlottie::Surface const&, bool) (lottieanimation.cpp:118)
==1821184== by 0x48F7AF3: rlottie::Animation::renderSync(unsigned long, rlottie::Surface, bool) (lottieanimation.cpp:371)
==1821184== Uninitialised value was created by a stack allocation
==1821184== at 0x48E41FA: void LottieParserImpl::parseKeyFrame<float, void>(rlottie::internal::model::KeyFrames<float, void>&) (lottieparser.cpp:2010)
==1821184==
==1821184== Conditional jump or move depends on uninitialised value(s)
==1821184== at 0x4899F93: VMatrix::rotate(float, VMatrix::Axis) (vmatrix.cpp:244)
==1821184== by 0x48C968F: rlottie::internal::model::Transform::Data::matrix(int, bool) const (lottiemodel.cpp:197)
==1821184== by 0x48AE69D: rlottie::internal::model::Transform::matrix(int, bool) const (lottiemodel.h:618)
==1821184== by 0x48AE918: rlottie::internal::model::Layer::matrix(int) const (lottiemodel.h:700)
==1821184== by 0x48A7C3D: rlottie::internal::renderer::Layer::matrix(int) const (lottieitem.cpp:440)
==1821184== by 0x48A79D9: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:404)
==1821184== by 0x48A8DF4: rlottie::internal::renderer::CompLayer::updateContent() (lottieitem.cpp:653)
==1821184== by 0x48A7B60: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:430)
==1821184== by 0x48A62F1: rlottie::internal::renderer::Composition::update(int, VSize const&, bool) (lottieitem.cpp:146)
==1821184== by 0x48F6E79: AnimationImpl::update(unsigned long, VSize const&, bool) (lottieanimation.cpp:105)
==1821184== by 0x48F6F90: AnimationImpl::render(unsigned long, rlottie::Surface const&, bool) (lottieanimation.cpp:118)
==1821184== by 0x48F7AF3: rlottie::Animation::renderSync(unsigned long, rlottie::Surface, bool) (lottieanimation.cpp:371)
==1821184== Uninitialised value was created by a stack allocation
==1821184== at 0x48E41FA: void LottieParserImpl::parseKeyFrame<float, void>(rlottie::internal::model::KeyFrames<float, void>&) (lottieparser.cpp:2010)
==1821184==
==1821184== Conditional jump or move depends on uninitialised value(s)
==1821184== at 0x4899FA4: VMatrix::rotate(float, VMatrix::Axis) (vmatrix.cpp:244)
==1821184== by 0x48C968F: rlottie::internal::model::Transform::Data::matrix(int, bool) const (lottiemodel.cpp:197)
==1821184== by 0x48AE69D: rlottie::internal::model::Transform::matrix(int, bool) const (lottiemodel.h:618)
==1821184== by 0x48AE918: rlottie::internal::model::Layer::matrix(int) const (lottiemodel.h:700)
==1821184== by 0x48A7C3D: rlottie::internal::renderer::Layer::matrix(int) const (lottieitem.cpp:440)
==1821184== by 0x48A79D9: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:404)
==1821184== by 0x48A8DF4: rlottie::internal::renderer::CompLayer::updateContent() (lottieitem.cpp:653)
==1821184== by 0x48A7B60: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:430)
==1821184== by 0x48A62F1: rlottie::internal::renderer::Composition::update(int, VSize const&, bool) (lottieitem.cpp:146)
==1821184== by 0x48F6E79: AnimationImpl::update(unsigned long, VSize const&, bool) (lottieanimation.cpp:105)
==1821184== by 0x48F6F90: AnimationImpl::render(unsigned long, rlottie::Surface const&, bool) (lottieanimation.cpp:118)
==1821184== by 0x48F7AF3: rlottie::Animation::renderSync(unsigned long, rlottie::Surface, bool) (lottieanimation.cpp:371)
==1821184== Uninitialised value was created by a stack allocation
==1821184== at 0x48E41FA: void LottieParserImpl::parseKeyFrame<float, void>(rlottie::internal::model::KeyFrames<float, void>&) (lottieparser.cpp:2010)
==1821184==
==1821184== Conditional jump or move depends on uninitialised value(s)
==1821184== at 0x4899FCA: VMatrix::rotate(float, VMatrix::Axis) (vmatrix.cpp:246)
==1821184== by 0x48C968F: rlottie::internal::model::Transform::Data::matrix(int, bool) const (lottiemodel.cpp:197)
==1821184== by 0x48AE69D: rlottie::internal::model::Transform::matrix(int, bool) const (lottiemodel.h:618)
==1821184== by 0x48AE918: rlottie::internal::model::Layer::matrix(int) const (lottiemodel.h:700)
==1821184== by 0x48A7C3D: rlottie::internal::renderer::Layer::matrix(int) const (lottieitem.cpp:440)
==1821184== by 0x48A79D9: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:404)
==1821184== by 0x48A8DF4: rlottie::internal::renderer::CompLayer::updateContent() (lottieitem.cpp:653)
==1821184== by 0x48A7B60: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:430)
==1821184== by 0x48A62F1: rlottie::internal::renderer::Composition::update(int, VSize const&, bool) (lottieitem.cpp:146)
==1821184== by 0x48F6E79: AnimationImpl::update(unsigned long, VSize const&, bool) (lottieanimation.cpp:105)
==1821184== by 0x48F6F90: AnimationImpl::render(unsigned long, rlottie::Surface const&, bool) (lottieanimation.cpp:118)
==1821184== by 0x48F7AF3: rlottie::Animation::renderSync(unsigned long, rlottie::Surface, bool) (lottieanimation.cpp:371)
==1821184== Uninitialised value was created by a stack allocation
==1821184== at 0x48E41FA: void LottieParserImpl::parseKeyFrame<float, void>(rlottie::internal::model::KeyFrames<float, void>&) (lottieparser.cpp:2010)
==1821184==
==1821184== Conditional jump or move depends on uninitialised value(s)
==1821184== at 0x4899FDB: VMatrix::rotate(float, VMatrix::Axis) (vmatrix.cpp:246)
==1821184== by 0x48C968F: rlottie::internal::model::Transform::Data::matrix(int, bool) const (lottiemodel.cpp:197)
==1821184== by 0x48AE69D: rlottie::internal::model::Transform::matrix(int, bool) const (lottiemodel.h:618)
==1821184== by 0x48AE918: rlottie::internal::model::Layer::matrix(int) const (lottiemodel.h:700)
==1821184== by 0x48A7C3D: rlottie::internal::renderer::Layer::matrix(int) const (lottieitem.cpp:440)
==1821184== by 0x48A79D9: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:404)
==1821184== by 0x48A8DF4: rlottie::internal::renderer::CompLayer::updateContent() (lottieitem.cpp:653)
==1821184== by 0x48A7B60: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:430)
==1821184== by 0x48A62F1: rlottie::internal::renderer::Composition::update(int, VSize const&, bool) (lottieitem.cpp:146)
==1821184== by 0x48F6E79: AnimationImpl::update(unsigned long, VSize const&, bool) (lottieanimation.cpp:105)
==1821184== by 0x48F6F90: AnimationImpl::render(unsigned long, rlottie::Surface const&, bool) (lottieanimation.cpp:118)
==1821184== by 0x48F7AF3: rlottie::Animation::renderSync(unsigned long, rlottie::Surface, bool) (lottieanimation.cpp:371)
==1821184== Uninitialised value was created by a stack allocation
==1821184== at 0x48E41FA: void LottieParserImpl::parseKeyFrame<float, void>(rlottie::internal::model::KeyFrames<float, void>&) (lottieparser.cpp:2010)
==1821184==
==1821184== Conditional jump or move depends on uninitialised value(s)
==1821184== at 0x4899FEC: VMatrix::rotate(float, VMatrix::Axis) (vmatrix.cpp:246)
==1821184== by 0x48C968F: rlottie::internal::model::Transform::Data::matrix(int, bool) const (lottiemodel.cpp:197)
==1821184== by 0x48AE69D: rlottie::internal::model::Transform::matrix(int, bool) const (lottiemodel.h:618)
==1821184== by 0x48AE918: rlottie::internal::model::Layer::matrix(int) const (lottiemodel.h:700)
==1821184== by 0x48A7C3D: rlottie::internal::renderer::Layer::matrix(int) const (lottieitem.cpp:440)
==1821184== by 0x48A79D9: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:404)
==1821184== by 0x48A8DF4: rlottie::internal::renderer::CompLayer::updateContent() (lottieitem.cpp:653)
==1821184== by 0x48A7B60: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:430)
==1821184== by 0x48A62F1: rlottie::internal::renderer::Composition::update(int, VSize const&, bool) (lottieitem.cpp:146)
==1821184== by 0x48F6E79: AnimationImpl::update(unsigned long, VSize const&, bool) (lottieanimation.cpp:105)
==1821184== by 0x48F6F90: AnimationImpl::render(unsigned long, rlottie::Surface const&, bool) (lottieanimation.cpp:118)
==1821184== by 0x48F7AF3: rlottie::Animation::renderSync(unsigned long, rlottie::Surface, bool) (lottieanimation.cpp:371)
==1821184== Uninitialised value was created by a stack allocation
==1821184== at 0x48E41FA: void LottieParserImpl::parseKeyFrame<float, void>(rlottie::internal::model::KeyFrames<float, void>&) (lottieparser.cpp:2010)
==1821184==
==1821184== Conditional jump or move depends on uninitialised value(s)
==1821184== at 0x4899FFD: VMatrix::rotate(float, VMatrix::Axis) (vmatrix.cpp:246)
==1821184== by 0x48C968F: rlottie::internal::model::Transform::Data::matrix(int, bool) const (lottiemodel.cpp:197)
==1821184== by 0x48AE69D: rlottie::internal::model::Transform::matrix(int, bool) const (lottiemodel.h:618)
==1821184== by 0x48AE918: rlottie::internal::model::Layer::matrix(int) const (lottiemodel.h:700)
==1821184== by 0x48A7C3D: rlottie::internal::renderer::Layer::matrix(int) const (lottieitem.cpp:440)
==1821184== by 0x48A79D9: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:404)
==1821184== by 0x48A8DF4: rlottie::internal::renderer::CompLayer::updateContent() (lottieitem.cpp:653)
==1821184== by 0x48A7B60: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:430)
==1821184== by 0x48A62F1: rlottie::internal::renderer::Composition::update(int, VSize const&, bool) (lottieitem.cpp:146)
==1821184== by 0x48F6E79: AnimationImpl::update(unsigned long, VSize const&, bool) (lottieanimation.cpp:105)
==1821184== by 0x48F6F90: AnimationImpl::render(unsigned long, rlottie::Surface const&, bool) (lottieanimation.cpp:118)
==1821184== by 0x48F7AF3: rlottie::Animation::renderSync(unsigned long, rlottie::Surface, bool) (lottieanimation.cpp:371)
==1821184== Uninitialised value was created by a stack allocation
==1821184== at 0x48E41FA: void LottieParserImpl::parseKeyFrame<float, void>(rlottie::internal::model::KeyFrames<float, void>&) (lottieparser.cpp:2010)
==1821184==
==1821184== Conditional jump or move depends on uninitialised value(s)
==1821184== at 0x489A023: VMatrix::rotate(float, VMatrix::Axis) (vmatrix.cpp:248)
==1821184== by 0x48C968F: rlottie::internal::model::Transform::Data::matrix(int, bool) const (lottiemodel.cpp:197)
==1821184== by 0x48AE69D: rlottie::internal::model::Transform::matrix(int, bool) const (lottiemodel.h:618)
==1821184== by 0x48AE918: rlottie::internal::model::Layer::matrix(int) const (lottiemodel.h:700)
==1821184== by 0x48A7C3D: rlottie::internal::renderer::Layer::matrix(int) const (lottieitem.cpp:440)
==1821184== by 0x48A79D9: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:404)
==1821184== by 0x48A8DF4: rlottie::internal::renderer::CompLayer::updateContent() (lottieitem.cpp:653)
==1821184== by 0x48A7B60: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:430)
==1821184== by 0x48A62F1: rlottie::internal::renderer::Composition::update(int, VSize const&, bool) (lottieitem.cpp:146)
==1821184== by 0x48F6E79: AnimationImpl::update(unsigned long, VSize const&, bool) (lottieanimation.cpp:105)
==1821184== by 0x48F6F90: AnimationImpl::render(unsigned long, rlottie::Surface const&, bool) (lottieanimation.cpp:118)
==1821184== by 0x48F7AF3: rlottie::Animation::renderSync(unsigned long, rlottie::Surface, bool) (lottieanimation.cpp:371)
==1821184== Uninitialised value was created by a stack allocation
==1821184== at 0x48E41FA: void LottieParserImpl::parseKeyFrame<float, void>(rlottie::internal::model::KeyFrames<float, void>&) (lottieparser.cpp:2010)
==1821184==
==1821184== Conditional jump or move depends on uninitialised value(s)
==1821184== at 0x489A034: VMatrix::rotate(float, VMatrix::Axis) (vmatrix.cpp:248)
==1821184== by 0x48C968F: rlottie::internal::model::Transform::Data::matrix(int, bool) const (lottiemodel.cpp:197)
==1821184== by 0x48AE69D: rlottie::internal::model::Transform::matrix(int, bool) const (lottiemodel.h:618)
==1821184== by 0x48AE918: rlottie::internal::model::Layer::matrix(int) const (lottiemodel.h:700)
==1821184== by 0x48A7C3D: rlottie::internal::renderer::Layer::matrix(int) const (lottieitem.cpp:440)
==1821184== by 0x48A79D9: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:404)
==1821184== by 0x48A8DF4: rlottie::internal::renderer::CompLayer::updateContent() (lottieitem.cpp:653)
==1821184== by 0x48A7B60: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:430)
==1821184== by 0x48A62F1: rlottie::internal::renderer::Composition::update(int, VSize const&, bool) (lottieitem.cpp:146)
==1821184== by 0x48F6E79: AnimationImpl::update(unsigned long, VSize const&, bool) (lottieanimation.cpp:105)
==1821184== by 0x48F6F90: AnimationImpl::render(unsigned long, rlottie::Surface const&, bool) (lottieanimation.cpp:118)
==1821184== by 0x48F7AF3: rlottie::Animation::renderSync(unsigned long, rlottie::Surface, bool) (lottieanimation.cpp:371)
==1821184== Uninitialised value was created by a stack allocation
==1821184== at 0x48E41FA: void LottieParserImpl::parseKeyFrame<float, void>(rlottie::internal::model::KeyFrames<float, void>&) (lottieparser.cpp:2010)
==1821184==
==1821184== Conditional jump or move depends on uninitialised value(s)
==1821184== at 0x4DFE17F: __sinf_fma (s_sinf.c:45)
==1821184== by 0x489CD50: std::sin(float) (cmath:426)
==1821184== by 0x489A072: VMatrix::rotate(float, VMatrix::Axis) (vmatrix.cpp:252)
==1821184== by 0x48C968F: rlottie::internal::model::Transform::Data::matrix(int, bool) const (lottiemodel.cpp:197)
==1821184== by 0x48AE69D: rlottie::internal::model::Transform::matrix(int, bool) const (lottiemodel.h:618)
==1821184== by 0x48AE918: rlottie::internal::model::Layer::matrix(int) const (lottiemodel.h:700)
==1821184== by 0x48A7C3D: rlottie::internal::renderer::Layer::matrix(int) const (lottieitem.cpp:440)
==1821184== by 0x48A79D9: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:404)
==1821184== by 0x48A8DF4: rlottie::internal::renderer::CompLayer::updateContent() (lottieitem.cpp:653)
==1821184== by 0x48A7B60: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:430)
==1821184== by 0x48A62F1: rlottie::internal::renderer::Composition::update(int, VSize const&, bool) (lottieitem.cpp:146)
==1821184== by 0x48F6E79: AnimationImpl::update(unsigned long, VSize const&, bool) (lottieanimation.cpp:105)
==1821184== Uninitialised value was created by a stack allocation
==1821184== at 0x48E41FA: void LottieParserImpl::parseKeyFrame<float, void>(rlottie::internal::model::KeyFrames<float, void>&) (lottieparser.cpp:2010)
==1821184==
==1821184== Conditional jump or move depends on uninitialised value(s)
==1821184== at 0x4DFE1C9: __sinf_fma (s_sinf.c:59)
==1821184== by 0x489CD50: std::sin(float) (cmath:426)
==1821184== by 0x489A072: VMatrix::rotate(float, VMatrix::Axis) (vmatrix.cpp:252)
==1821184== by 0x48C968F: rlottie::internal::model::Transform::Data::matrix(int, bool) const (lottiemodel.cpp:197)
==1821184== by 0x48AE69D: rlottie::internal::model::Transform::matrix(int, bool) const (lottiemodel.h:618)
==1821184== by 0x48AE918: rlottie::internal::model::Layer::matrix(int) const (lottiemodel.h:700)
==1821184== by 0x48A7C3D: rlottie::internal::renderer::Layer::matrix(int) const (lottieitem.cpp:440)
==1821184== by 0x48A79D9: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:404)
==1821184== by 0x48A8DF4: rlottie::internal::renderer::CompLayer::updateContent() (lottieitem.cpp:653)
==1821184== by 0x48A7B60: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:430)
==1821184== by 0x48A62F1: rlottie::internal::renderer::Composition::update(int, VSize const&, bool) (lottieitem.cpp:146)
==1821184== by 0x48F6E79: AnimationImpl::update(unsigned long, VSize const&, bool) (lottieanimation.cpp:105)
==1821184== Uninitialised value was created by a stack allocation
==1821184== at 0x48E41FA: void LottieParserImpl::parseKeyFrame<float, void>(rlottie::internal::model::KeyFrames<float, void>&) (lottieparser.cpp:2010)
==1821184==
==1821184== Conditional jump or move depends on uninitialised value(s)
==1821184== at 0x4DFE285: __sinf_fma (s_sinf.c:71)
==1821184== by 0x489CD50: std::sin(float) (cmath:426)
==1821184== by 0x489A072: VMatrix::rotate(float, VMatrix::Axis) (vmatrix.cpp:252)
==1821184== by 0x48C968F: rlottie::internal::model::Transform::Data::matrix(int, bool) const (lottiemodel.cpp:197)
==1821184== by 0x48AE69D: rlottie::internal::model::Transform::matrix(int, bool) const (lottiemodel.h:618)
==1821184== by 0x48AE918: rlottie::internal::model::Layer::matrix(int) const (lottiemodel.h:700)
==1821184== by 0x48A7C3D: rlottie::internal::renderer::Layer::matrix(int) const (lottieitem.cpp:440)
==1821184== by 0x48A79D9: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:404)
==1821184== by 0x48A8DF4: rlottie::internal::renderer::CompLayer::updateContent() (lottieitem.cpp:653)
==1821184== by 0x48A7B60: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:430)
==1821184== by 0x48A62F1: rlottie::internal::renderer::Composition::update(int, VSize const&, bool) (lottieitem.cpp:146)
==1821184== by 0x48F6E79: AnimationImpl::update(unsigned long, VSize const&, bool) (lottieanimation.cpp:105)
==1821184== Uninitialised value was created by a stack allocation
==1821184== at 0x48E41FA: void LottieParserImpl::parseKeyFrame<float, void>(rlottie::internal::model::KeyFrames<float, void>&) (lottieparser.cpp:2010)
==1821184==
==1821184== Use of uninitialised value of size 8
==1821184== at 0x4DFE2C0: reduce_large (s_sincosf.h:84)
==1821184== by 0x4DFE2C0: __sinf_fma (s_sinf.c:76)
==1821184== by 0x489CD50: std::sin(float) (cmath:426)
==1821184== by 0x489A072: VMatrix::rotate(float, VMatrix::Axis) (vmatrix.cpp:252)
==1821184== by 0x48C968F: rlottie::internal::model::Transform::Data::matrix(int, bool) const (lottiemodel.cpp:197)
==1821184== by 0x48AE69D: rlottie::internal::model::Transform::matrix(int, bool) const (lottiemodel.h:618)
==1821184== by 0x48AE918: rlottie::internal::model::Layer::matrix(int) const (lottiemodel.h:700)
==1821184== by 0x48A7C3D: rlottie::internal::renderer::Layer::matrix(int) const (lottieitem.cpp:440)
==1821184== by 0x48A79D9: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:404)
==1821184== by 0x48A8DF4: rlottie::internal::renderer::CompLayer::updateContent() (lottieitem.cpp:653)
==1821184== by 0x48A7B60: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:430)
==1821184== by 0x48A62F1: rlottie::internal::renderer::Composition::update(int, VSize const&, bool) (lottieitem.cpp:146)
==1821184== by 0x48F6E79: AnimationImpl::update(unsigned long, VSize const&, bool) (lottieanimation.cpp:105)
==1821184== Uninitialised value was created by a stack allocation
==1821184== at 0x48E41FA: void LottieParserImpl::parseKeyFrame<float, void>(rlottie::internal::model::KeyFrames<float, void>&) (lottieparser.cpp:2010)
==1821184==
==1821184== Conditional jump or move depends on uninitialised value(s)
==1821184== at 0x4DFE32D: sinf_poly (sincosf_poly.h:90)
==1821184== by 0x4DFE32D: __sinf_fma (s_sinf.c:84)
==1821184== by 0x489CD50: std::sin(float) (cmath:426)
==1821184== by 0x489A072: VMatrix::rotate(float, VMatrix::Axis) (vmatrix.cpp:252)
==1821184== by 0x48C968F: rlottie::internal::model::Transform::Data::matrix(int, bool) const (lottiemodel.cpp:197)
==1821184== by 0x48AE69D: rlottie::internal::model::Transform::matrix(int, bool) const (lottiemodel.h:618)
==1821184== by 0x48AE918: rlottie::internal::model::Layer::matrix(int) const (lottiemodel.h:700)
==1821184== by 0x48A7C3D: rlottie::internal::renderer::Layer::matrix(int) const (lottieitem.cpp:440)
==1821184== by 0x48A79D9: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:404)
==1821184== by 0x48A8DF4: rlottie::internal::renderer::CompLayer::updateContent() (lottieitem.cpp:653)
==1821184== by 0x48A7B60: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:430)
==1821184== by 0x48A62F1: rlottie::internal::renderer::Composition::update(int, VSize const&, bool) (lottieitem.cpp:146)
==1821184== by 0x48F6E79: AnimationImpl::update(unsigned long, VSize const&, bool) (lottieanimation.cpp:105)
==1821184== Uninitialised value was created by a stack allocation
==1821184== at 0x48E41FA: void LottieParserImpl::parseKeyFrame<float, void>(rlottie::internal::model::KeyFrames<float, void>&) (lottieparser.cpp:2010)
==1821184==
==1821184== Use of uninitialised value of size 8
==1821184== at 0x4DFE332: sinf_poly (sincosf_poly.h:93)
==1821184== by 0x4DFE332: __sinf_fma (s_sinf.c:84)
==1821184== by 0x489CD50: std::sin(float) (cmath:426)
==1821184== by 0x489A072: VMatrix::rotate(float, VMatrix::Axis) (vmatrix.cpp:252)
==1821184== by 0x48C968F: rlottie::internal::model::Transform::Data::matrix(int, bool) const (lottiemodel.cpp:197)
==1821184== by 0x48AE69D: rlottie::internal::model::Transform::matrix(int, bool) const (lottiemodel.h:618)
==1821184== by 0x48AE918: rlottie::internal::model::Layer::matrix(int) const (lottiemodel.h:700)
==1821184== by 0x48A7C3D: rlottie::internal::renderer::Layer::matrix(int) const (lottieitem.cpp:440)
==1821184== by 0x48A79D9: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:404)
==1821184== by 0x48A8DF4: rlottie::internal::renderer::CompLayer::updateContent() (lottieitem.cpp:653)
==1821184== by 0x48A7B60: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:430)
==1821184== by 0x48A62F1: rlottie::internal::renderer::Composition::update(int, VSize const&, bool) (lottieitem.cpp:146)
==1821184== by 0x48F6E79: AnimationImpl::update(unsigned long, VSize const&, bool) (lottieanimation.cpp:105)
==1821184== Uninitialised value was created by a stack allocation
... truncated because of GitHub limits ...
==1821184== Conditional jump or move depends on uninitialised value(s)
==1821184== at 0x489BB8C: VMatrix::fuzzyCompare(VMatrix const&) const (vmatrix.cpp:557)
==1821184== by 0x489BB2C: VMatrix::operator==(VMatrix const&) const (vmatrix.cpp:545)
==1821184== by 0x489BB56: VMatrix::operator!=(VMatrix const&) const (vmatrix.cpp:550)
==1821184== by 0x48A7A03: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:408)
==1821184== by 0x48A8DF4: rlottie::internal::renderer::CompLayer::updateContent() (lottieitem.cpp:653)
==1821184== by 0x48A7B60: rlottie::internal::renderer::Layer::update(int, VMatrix const&, float) (lottieitem.cpp:430)
==1821184== by 0x48A62F1: rlottie::internal::renderer::Composition::update(int, VSize const&, bool) (lottieitem.cpp:146)
==1821184== by 0x48F6E79: AnimationImpl::update(unsigned long, VSize const&, bool) (lottieanimation.cpp:105)
==1821184== by 0x48F6F90: AnimationImpl::render(unsigned long, rlottie::Surface const&, bool) (lottieanimation.cpp:118)
==1821184== by 0x48F7AF3: rlottie::Animation::renderSync(unsigned long, rlottie::Surface, bool) (lottieanimation.cpp:371)
==1821184== by 0x10F300: App::render(unsigned int, unsigned int) (lottie2gif.cpp:91)
==1821184== by 0x10EC34: main (lottie2gif.cpp:175)
==1821184==
Generated GIF file : 001f.json.gif
==1821184==
==1821184== HEAP SUMMARY:
==1821184== in use at exit: 0 bytes in 0 blocks
==1821184== total heap usage: 47 allocs, 47 frees, 20,727,784 bytes allocated
==1821184==
==1821184== All heap blocks were freed -- no leaks are possible
==1821184==
==1821184== For lists of detected and suppressed errors, rerun with: -s
==1821184== ERROR SUMMARY: 28 errors from 28 contexts (suppressed: 0 from 0)
Case 2
Accessing elements of empty vector.
002f.json {"v":"0","op":1,"layers":[{"ty":4,"ks":{},"shapes":[{"ty":"gr","it":[{"ty":"sh","ks":{"k":[{}]}}]}],"op":1}]}
Click to see output (gdb ...)
mymedia@barberry:~/rlottie$ gdb -ex run -ex bt\ full -ex q --args build/example/lottie2gif fuzz/collect/002f.json
Reading symbols from build/example/lottie2gif...
Starting program: /home/mymedia/rlottie/build/example/lottie2gif fuzz/collect/002f.json
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
rlottie::internal::model::Property<rlottie::internal::model::PathData, void>::value<rlottie::internal::model::PathData> (this=0x555555573968, frameNo=0, path=...) at ./src/lottie/lottiemodel.h:343
343 if (vec.front().start_ >= frameNo)
#0 rlottie::internal::model::Property<rlottie::internal::model::PathData, void>::value<rlottie::internal::model::PathData> (this=0x555555573968, frameNo=0, path=...) at ./src/lottie/lottiemodel.h:343
vec = std::vector of length 0, capacity 0
#1 0x00007ffff7f5e2dc in rlottie::internal::renderer::Path::updatePath (this=0x555555574360, path=..., frameNo=0) at ./src/lottie/lottieitem.cpp:1141
No locals.
#2 0x00007ffff7f5ddab in rlottie::internal::renderer::Shape::update (this=0x555555574360, frameNo=0, flag=...) at ./src/lottie/lottieitem.cpp:1082
No locals.
#3 0x00007ffff7f5d8c1 in rlottie::internal::renderer::Group::update (this=0x555555574300, frameNo=0, parentMatrix=..., parentAlpha=1, flag=...) at ./src/lottie/lottieitem.cpp:971
content = @0x5555555749d0: 0x555555574360
__for_range = std::vector of length 1, capacity 1 = {0x555555574360}
__for_begin = 0x555555574360
__for_end = 0x7ffff7caccc0 <main_arena+96>
newFlag = {i = 3}
alpha = 1
#4 0x00007ffff7f5d8c1 in rlottie::internal::renderer::Group::update (this=0x5555555742a0, frameNo=0, parentMatrix=..., parentAlpha=1, flag=...) at ./src/lottie/lottieitem.cpp:971
content = @0x5555555749b0: 0x555555574300
__for_range = std::vector of length 1, capacity 1 = {0x555555574300}
__for_begin = 0x555555574300
__for_end = 0x7ffff7caccc0 <main_arena+96>
newFlag = {i = 3}
alpha = 1
#5 0x00007ffff7f5cb3e in rlottie::internal::renderer::ShapeLayer::updateContent (this=0x555555574218) at ./src/lottie/lottieitem.cpp:839
No locals.
#6 0x00007ffff7f5ab61 in rlottie::internal::renderer::Layer::update (this=0x555555574218, frameNumber=0, parentMatrix=..., parentAlpha=1) at ./src/lottie/lottieitem.cpp:430
alpha = 1
m = {m11 = inf, m12 = 0, m13 = 0, m21 = 0, m22 = inf, m23 = 0, mtx = -nan(0x400000), mty = -nan(0x400000), m33 = 1, mType = VMatrix::MatrixType::Scale, dirty = VMatrix::MatrixType::None}
#7 0x00007ffff7f5bdf5 in rlottie::internal::renderer::CompLayer::updateContent (this=0x555555574190) at ./src/lottie/lottieitem.cpp:653
layer = @0x555555574990: 0x555555574218
__for_range = std::vector of length 1, capacity 1 = {0x555555574218}
__for_begin = 0x555555574218
__for_end = 0x7ffff7cad290 <main_arena+1584>
mappedFrame = 0
alpha = 1
#8 0x00007ffff7f5ab61 in rlottie::internal::renderer::Layer::update (this=0x555555574190, frameNumber=0, parentMatrix=..., parentAlpha=1) at ./src/lottie/lottieitem.cpp:430
alpha = 1
m = {m11 = inf, m12 = 0, m13 = 0, m21 = 0, m22 = inf, m23 = 0, mtx = -nan(0x400000), mty = -nan(0x400000), m33 = 1, mType = VMatrix::MatrixType::Scale, dirty = VMatrix::MatrixType::None}
#9 0x00007ffff7f592f2 in rlottie::internal::renderer::Composition::update (this=0x555555574070, frameNo=0, size=..., keepAspectRatio=true) at ./src/lottie/lottieitem.cpp:146
m = {m11 = inf, m12 = 0, m13 = 0, m21 = 0, m22 = inf, m23 = 0, mtx = -nan(0x400000), mty = -nan(0x400000), m33 = 1, mType = VMatrix::MatrixType::Scale, dirty = VMatrix::MatrixType::None}
viewPort = {mw = 200, mh = 200}
viewBox = {mw = 0, mh = 0}
sx = inf
sy = inf
#10 0x00007ffff7fa9e7a in AnimationImpl::update (this=0x555555573500, frameNo=0, size=..., keepAspectRatio=true) at ./src/lottie/lottieanimation.cpp:105
No locals.
#11 0x00007ffff7fa9f91 in AnimationImpl::render (this=0x555555573500, frameNo=0, surface=..., keepAspectRatio=true) at ./src/lottie/lottieanimation.cpp:118
renderInProgress = false
#12 0x00007ffff7faaaf4 in rlottie::Animation::renderSync (this=0x555555573550, frameNo=0, surface=..., keepAspectRatio=true) at ./src/lottie/lottieanimation.cpp:371
No locals.
#13 0x000055555555b301 in App::render (this=0x7fffffffd9c0, w=200, h=200) at ./example/lottie2gif.cpp:91
surface = {mBuffer = 0x7ffff7983010, mWidth = 200, mHeight = 200, mBytesPerLine = 800, mDrawArea = {x = 0, y = 0, w = 200, h = 200}}
i = 0
player = std::unique_ptr<rlottie::Animation> = {get() = {<No data fields>}}
buffer = std::unique_ptr<unsigned int []> = {get() = {<No data fields>}}
frameCount = 1
builder = {handle = {f = 0x555555573320, oldImage = 0x7ffff795b010 "", firstFrame = true}, bgColorR = 255 '\377', bgColorG = 255 '\377', bgColorB = 255 '\377'}
#14 0x000055555555ac35 in main (argc=2, argv=0x7fffffffdb48) at ./example/lottie2gif.cpp:175
app = {bgColor = -1, fileName = "/home/mymedia/rlottie/fuzz/collect/002f.json", gifName = "002f.json.gif"}
w = 200
h = 200
#15 0x00007ffff7ac1fd0 in __libc_start_call_main (main=main@entry=0x55555555abbe <main(int, char**)>, argc=argc@entry=2, argv=argv@entry=0x7fffffffdb48) at ../sysdeps/nptl/libc_start_call_main.h:58
self = <optimized out>
result = <optimized out>
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, -5304380250038046668, 140737488345928, 93824992259006, 0, 140737354120256, 5304380248853737524, 5304361971744665652}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x10000ffff, 0x7fffffffdac0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 65535}}}
not_first_call = <optimized out>
#16 0x00007ffff7ac207d in __libc_start_main_impl (main=0x55555555abbe <main(int, char**)>, argc=2, argv=0x7fffffffdb48, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdb38) at ../csu/libc-start.c:409
No locals.
#17 0x00005555555585a5 in _start ()
No symbol table info available.
Cases 3, 4, 5
Stack overflow on cyclic structures.
009f.json {"v":"0","assets":[{"id":"a","layers":[{"ks":{},"ty":0,"refId":"a"}]}],"layers":[{"ks":{},"ty":0,"refId":"a"}]}
010f.json {"v":"0","assets":[{"id":"b","layers":[{"ks":{},"ty":0,"refId":"b"}]}],"layers":[{"ks":{}},{"ks":{},"ty":0,"refId":"b"}]}
011f.json {"v":"0","assets":[{"id":"c","layers":[{"ks":{},"ty":0,"refId":"c"}]}],"layers":[{"ks":{},"ty":0,"refId":"c"},{"ks":{},"ty":0,"refId":""}]}
(Sorry for gaps between file numbers. I tried to minimize other samples but they seem irrelevant).
Click to see output (gdb ...)
mymedia@barberry:~/rlottie$ gdb -ex run -ex bt\ full\ -20 -ex q --args build/example/lottie2gif fuzz/collect/009f.json
Reading symbols from build/example/lottie2gif...
Starting program: /home/mymedia/rlottie/build/example/lottie2gif fuzz/collect/009f.json
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7f7ea48 in std::vector<rlottie::internal::model::Object*, std::allocator<rlottie::internal::model::Object*> >::end (this=<error reading variable: Cannot access memory at address 0x7fffff7feff8>) at /usr/include/c++/11/bits/stl_vector.h:829
829 end() _GLIBCXX_NOEXCEPT
#104755 0x00007ffff7f7e180 in LottieRepeaterProcesser::visit (this=0x7fffffffd317, obj=0x5555555737e8) at ./src/lottie/lottiemodel.cpp:85
No locals.
#104756 0x00007ffff7f7e0e7 in LottieRepeaterProcesser::visitChildren (this=0x7fffffffd317, obj=0x5555555737e8) at ./src/lottie/lottiemodel.cpp:76
child = 0x5555555737e8
i = {<std::iterator<std::random_access_iterator_tag, rlottie::internal::model::Object*, long, rlottie::internal::model::Object**, rlottie::internal::model::Object*&>> = {<No data fields>}, current = 0x7ffff7caccc0 <main_arena+96>}
#104757 0x00007ffff7f7e180 in LottieRepeaterProcesser::visit (this=0x7fffffffd317, obj=0x5555555737e8) at ./src/lottie/lottiemodel.cpp:85
No locals.
#104758 0x00007ffff7f7e0e7 in LottieRepeaterProcesser::visitChildren (this=0x7fffffffd317, obj=0x5555555737e8) at ./src/lottie/lottiemodel.cpp:76
child = 0x5555555737e8
i = {<std::iterator<std::random_access_iterator_tag, rlottie::internal::model::Object*, long, rlottie::internal::model::Object**, rlottie::internal::model::Object*&>> = {<No data fields>}, current = 0x7ffff7caccc0 <main_arena+96>}
#104759 0x00007ffff7f7e180 in LottieRepeaterProcesser::visit (this=0x7fffffffd317, obj=0x5555555737e8) at ./src/lottie/lottiemodel.cpp:85
No locals.
#104760 0x00007ffff7f7e0e7 in LottieRepeaterProcesser::visitChildren (this=0x7fffffffd317, obj=0x5555555737e8) at ./src/lottie/lottiemodel.cpp:76
child = 0x5555555737e8
i = {<std::iterator<std::random_access_iterator_tag, rlottie::internal::model::Object*, long, rlottie::internal::model::Object**, rlottie::internal::model::Object*&>> = {<No data fields>}, current = 0x7ffff7caccc0 <main_arena+96>}
#104761 0x00007ffff7f7e180 in LottieRepeaterProcesser::visit (this=0x7fffffffd317, obj=0x5555555737e8) at ./src/lottie/lottiemodel.cpp:85
No locals.
#104762 0x00007ffff7f7e0e7 in LottieRepeaterProcesser::visitChildren (this=0x7fffffffd317, obj=0x555555573970) at ./src/lottie/lottiemodel.cpp:76
child = 0x5555555737e8
i = {<std::iterator<std::random_access_iterator_tag, rlottie::internal::model::Object*, long, rlottie::internal::model::Object**, rlottie::internal::model::Object*&>> = {<No data fields>}, current = 0x7ffff7caccc0 <main_arena+96>}
#104763 0x00007ffff7f7e180 in LottieRepeaterProcesser::visit (this=0x7fffffffd317, obj=0x555555573970) at ./src/lottie/lottiemodel.cpp:85
No locals.
#104764 0x00007ffff7f7e0e7 in LottieRepeaterProcesser::visitChildren (this=0x7fffffffd317, obj=0x555555573900) at ./src/lottie/lottiemodel.cpp:76
child = 0x555555573970
i = {<std::iterator<std::random_access_iterator_tag, rlottie::internal::model::Object*, long, rlottie::internal::model::Object**, rlottie::internal::model::Object*&>> = {<No data fields>}, current = 0x0}
#104765 0x00007ffff7f7e180 in LottieRepeaterProcesser::visit (this=0x7fffffffd317, obj=0x555555573900) at ./src/lottie/lottiemodel.cpp:85
No locals.
#104766 0x00007ffff7f7bff4 in rlottie::internal::model::Composition::processRepeaterObjects (this=0x555555573690) at ./src/lottie/lottiemodel.cpp:152
visitor = {<No data fields>}
#104767 0x00007ffff7f8a8d5 in rlottie::internal::model::parse(char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::function<void (float&, float&, float&)>) (str=0x555555575510 "{\"v", dir_path="", filter=...) at ./src/lottie/lottieparser.cpp:2378
composition = std::shared_ptr<rlottie::internal::model::Composition> (use count 2, weak count 0) = {get() = 0x555555573690}
obj = {<LookaheadParserHandler> = {v_ = {data_ = {s = {length = 1, hashcode = 0, str = 0x40555555557557a <error: Cannot access memory at address 0x40555555557557a>}, ss = {str = "\001\000\000\000\000\000\000\000zUWUUU"}, n = {i = {i = 1, padding = "\000\000\000"}, u = {u = 1, padding2 = "\000\000\000"}, i64 = 1, u64 = 1, d = 4.9406564584124654e-324}, o = {size = 1, capacity = 0, members = 0x40555555557557a}, a = {size = 1, capacity = 0, elements = 0x40555555557557a}, f = {payload = "\001\000\000\000\000\000\000\000zUWUUU", flags = 1029}}}, st_ = LookaheadParserHandler::kExitingObject, r_ = {static kDefaultStackCapacity = 256, stack_ = {allocator_ = 0x555555573550, ownAllocator_ = 0x555555573550, stack_ = 0x555555573570 "\002", stackTop_ = 0x555555573570 "\002", stackEnd_ = 0x555555573670 "", initialCapacity_ = 256}, parseResult_ = {code_ = rapidjson::kParseErrorNone, offset_ = 0}, state_ = rapidjson::GenericReader<rapidjson::UTF8<char>, rapidjson::UTF8<char>, rapidjson::CrtAllocator>::IterativeParsingFinishState}, ss_ = {src_ = 0x555555575580 "", dst_ = 0x55555557557c "}]}\n", head_ = 0x555555575510 "{\"v"}, static parseFlags = 1}, mColorFilter = {<std::_Maybe_unary_or_binary_function<void, float&, float&, float&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x0, _M_const_object = 0x0, _M_function_pointer = 0x0, _M_member_pointer = NULL}, _M_pod_data = '\000' <repeats 15 times>}, _M_manager = 0x0}, _M_invoker = 0x0}, mPathInfo = {mInPoint = std::vector of length 0, capacity 0, mOutPoint = std::vector of length 0, capacity 0, mVertices = std::vector of length 0, capacity 0, mResult = std::vector of length 0, capacity 0, mClosed = false}, mInterpolatorCache = std::unordered_map with 0 elements, mComposition = std::shared_ptr<rlottie::internal::model::Composition> (use count 2, weak count 0) = {get() = 0x555555573690}, compRef = 0x555555573690, curLayerRef = 0x555555573970, mLayersToUpdate = std::vector of length 2, capacity 2 = {0x5555555737e8, 0x555555573970}, mDirPath = "/home/mymedia/rlottie/fuzz/collect/"}
#104768 0x00007ffff7f7b877 in rlottie::internal::model::loadFromFile (path="/home/mymedia/rlottie/fuzz/collect/009f.json", cachePolicy=true) at ./src/lottie/lottieloader.cpp:139
content = "{\"v\000:\"0\000,\"assets\000:[{\"id\000:\"a\000,\"layers\000:[{\"ks\000:{},\"ty\000:0,\"refId\000:\"a\000}]}],\"layers\000:[{\"ks\000:{},\"ty\000:0,\"refId\000:\"a\000}]}\n"
obj = std::shared_ptr<rlottie::internal::model::Composition> (empty) = {get() = 0x0}
f = <incomplete type>
#104769 0x00007ffff7faa776 in rlottie::Animation::loadFromFile (path="/home/mymedia/rlottie/fuzz/collect/009f.json", cachePolicy=true) at ./src/lottie/lottieanimation.cpp:319
composition = std::shared_ptr<rlottie::internal::model::Composition> (empty) = {get() = 0x0}
#104770 0x000055555555b150 in App::render (this=0x7fffffffd9c0, w=200, h=200) at ./example/lottie2gif.cpp:82
player = std::unique_ptr<rlottie::Animation> = {get() = {<No data fields>}}
buffer = std::unique_ptr<unsigned int []> = {get() = {<No data fields>}}
frameCount = 140737353009600
builder = {handle = {f = 0x7ffff7eeca60, oldImage = 0x7ffff7eedb00 "@\327\356\367\377\177", firstFrame = 176}, bgColorR = 32 ' ', bgColorG = 6 '\006', bgColorB = 252 '\374'}
#104771 0x000055555555ac35 in main (argc=2, argv=0x7fffffffdb48) at ./example/lottie2gif.cpp:175
app = {bgColor = -1, fileName = "/home/mymedia/rlottie/fuzz/collect/009f.json", gifName = "009f.json.gif"}
w = 200
h = 200
#104772 0x00007ffff7ac1fd0 in __libc_start_call_main (main=main@entry=0x55555555abbe <main(int, char**)>, argc=argc@entry=2, argv=argv@entry=0x7fffffffdb48) at ../sysdeps/nptl/libc_start_call_main.h:58
self = <optimized out>
result = <optimized out>
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, 2290260297761485036, 140737488345928, 93824992259006, 0, 140737354120256, -2290260296781729556, -2290277483006856980}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x10000ffff, 0x7fffffffdac0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 65535}}}
not_first_call = <optimized out>
#104773 0x00007ffff7ac207d in __libc_start_main_impl (main=0x55555555abbe <main(int, char**)>, argc=2, argv=0x7fffffffdb48, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdb38) at ../csu/libc-start.c:409
No locals.
#104774 0x00005555555585a5 in _start ()
No symbol table info available.
Case 6
Stack overflow at VBezier::length().
013f.json {"v":"0","op":9,"layers":[{"ty":4,"ks":{},"shapes":[{"ty":"gr","it":[{"ty":"sh","ks":{"k":{"i":[[],[]],"o":[[0,2000000000],[]],"v":[[],[1200000]]}}}]},{"ty":"tm","s":{"k":[{"i":{},"s":[100]},{"t":9}]}}],"op":9}]}
I did some fuzzing and found six interesting JSONs that cause to crashes or undefined behaviour. It would be great to have them fixed.
Case 1
Valgrid noticed usage of uninitialized values.
001f.json
{"v":"0","op":9,"layers":[{"ddd":0,"ks":{"r":{"k":[{"i":{},"":0}]}},"op":1}]}
Click to see output (valgrind ...)
Case 2
Accessing elements of empty vector.
002f.json
{"v":"0","op":1,"layers":[{"ty":4,"ks":{},"shapes":[{"ty":"gr","it":[{"ty":"sh","ks":{"k":[{}]}}]}],"op":1}]}
Click to see output (gdb ...)
Cases 3, 4, 5
Stack overflow on cyclic structures.
009f.json
{"v":"0","assets":[{"id":"a","layers":[{"ks":{},"ty":0,"refId":"a"}]}],"layers":[{"ks":{},"ty":0,"refId":"a"}]}
010f.json
{"v":"0","assets":[{"id":"b","layers":[{"ks":{},"ty":0,"refId":"b"}]}],"layers":[{"ks":{}},{"ks":{},"ty":0,"refId":"b"}]}
011f.json
{"v":"0","assets":[{"id":"c","layers":[{"ks":{},"ty":0,"refId":"c"}]}],"layers":[{"ks":{},"ty":0,"refId":"c"},{"ks":{},"ty":0,"refId":""}]}
(Sorry for gaps between file numbers. I tried to minimize other samples but they seem irrelevant).
Click to see output (gdb ...)
Case 6
Stack overflow at VBezier::length().
013f.json
{"v":"0","op":9,"layers":[{"ty":4,"ks":{},"shapes":[{"ty":"gr","it":[{"ty":"sh","ks":{"k":{"i":[[],[]],"o":[[0,2000000000],[]],"v":[[],[1200000]]}}}]},{"ty":"tm","s":{"k":[{"i":{},"s":[100]},{"t":9}]}}],"op":9}]}
Click to see output (gdb ...)
The text was updated successfully, but these errors were encountered: