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

Width and height validations don't cover all possible values #2350

Closed
tonyfu511 opened this issue Aug 1, 2023 · 0 comments · Fixed by #2351
Closed

Width and height validations don't cover all possible values #2350

tonyfu511 opened this issue Aug 1, 2023 · 0 comments · Fixed by #2351

Comments

@tonyfu511
Copy link
Contributor

Lottie is supported and developed on nights and weekends. Issues from Lottie sponsors will be prioritized.
Google
If you don't use this template, your issue will be closed. Delete this text once completed.

Checklist

  1. Fork this repository into your account.
  2. Reproduce your issue in the issue-repro module. Issues without a repro in the issue-repro
    module may be auto-closed.

Link to fork with a repro in the issue-repro module

Describe the bug
We received a production bug that the app crashed in LottieDrawable.

At https://github.com/airbnb/lottie-android/blob/master/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java#L1623, the code only check if (renderWidth == 0 || renderHeight == 0), and it should be changed to if (renderWidth <= 0 || renderHeight <= 0) to make sure covering all cases.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error
gpeal pushed a commit that referenced this issue Aug 1, 2023
IllegalArgumentException is thrown when creating bitmap in ensureSoftwareRenderingBitmap() if the getIntrinsicWidth or getIntrinsicHeight returns -1. So, returns when renderWidth or renderHeight is negative to avoid the crash

Fixes #2350
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.

1 participant