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

BitmapCalculator: fix use of a recycled bitmap #56

Merged
merged 1 commit into from
May 8, 2024

Conversation

sderr
Copy link
Contributor

@sderr sderr commented May 8, 2024

This commit fixes this warning message, which happens with the HSV color picker:

"Called getWidth() on a recycle()'d bitmap! This is undefined behavior!"

It is likely due to the fact that createScaledBitmap() will usually return a new bitmap, but will return the source bitmap if the dimensions are the same.

This commit makes sure that scaleBitmap() will always return a new bitmap.

This commit fixes this warning message which happens with the HSV
color picker:

 "Called getWidth() on a recycle()'d bitmap! This is undefined behavior!"

It is likely due to the fact that createScaledBitmap() will usually
return a new bitmap, but will return the source bitmap if the dimensions
are the same.

This commit makes sure that scaleBitmap() will always return a new
bitmap.
Copy link
Owner

@skydoves skydoves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@skydoves skydoves merged commit d5c4d45 into skydoves:main May 8, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants