Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in GradientColor.lerp in 5.2 and later #2298

Closed
imbryk opened this issue May 26, 2023 · 6 comments · Fixed by #2406
Closed

Crash in GradientColor.lerp in 5.2 and later #2298

imbryk opened this issue May 26, 2023 · 6 comments · Fixed by #2406

Comments

@imbryk
Copy link

imbryk commented May 26, 2023

Describe the bug
After #2081 has been merged, certain animations with gradient trasforms are crashing.

The issue is that here:
https://github.com/airbnb/lottie-android/blob/master/lottie/src/main/java/com/airbnb/lottie/parser/GradientColorParser.java#L148
the length of steps for GradientColor can change, and this can result in
https://github.com/airbnb/lottie-android/blob/master/lottie/src/main/java/com/airbnb/lottie/animation/keyframe/GradientColorKeyframeAnimation.java
receiving GradientColors of different lengths.

This eventually leads to crash in this line:
https://github.com/airbnb/lottie-android/blob/master/lottie/src/main/java/com/airbnb/lottie/model/content/GradientColor.java#L37
with
java.lang.ArrayIndexOutOfBoundsException

What version of Lottie did you test this on?
versions 5.2 and 6.0 experience the crash
version 5.1.1 works fine (it's before the mentioned PR has been merged)

What version of Android did you test this on?
Android version makes no difference - the crash is related to library code and specific lottie files

Steps To Reproduce
I've provided the crasshing lottie files to @gpeal
Every attempt to display the animation ends with ArrayIndexOutOfBoundsException

Screenshots
the app just crashes

@gpeal
Copy link
Collaborator

gpeal commented Jun 11, 2023

Could you provide an animation (preferably an AEP file) that crashes?

@fadi-quader-mox
Copy link

fadi-quader-mox commented Aug 30, 2023

My app crash with same exact error. It used to work before i bumped to latest version.
image

@gpeal
Copy link
Collaborator

gpeal commented Sep 2, 2023

Can you attach an animation that causes the crash? It'll be hard to debug or fix this without it.

@fadi-quader-mox
Copy link

fadi-quader-mox commented Sep 4, 2023

@gpeal Could you please share with me how I can contact you or where I can send the files?

@gpeal
Copy link
Collaborator

gpeal commented Sep 5, 2023

You can send it to lottietestapps [at] gmail

@MSchmidt
Copy link

@gpeal I've sent you another animation that crashes with java.lang.ArrayIndexOutOfBoundsException. Hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants