-
Notifications
You must be signed in to change notification settings - Fork 125
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
Optimize color counting #598
Conversation
Thank you, these changes look sensible. Do you have any clue on why |
I only have a core dump without the image, so I don't know exactly. A common tricky case that may be related is pixels having higher values than palette length. It also could have been 1x1 interlaced image. |
Thanks for this @kornelski. I'll take a closer look later and try to figure out what would actually cause this, but I'm surprised it can happen since:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both of your comments sound good! I think this PR could be merged as-is, as it's not exclusive with actually figuring out what's causing the bad len
, but I'll leave the final choice to @andrews05, given Andrews is more familiar with this code.
I managed to reproduce a crash at that point. @kornelski was right - it can happen when palette entries are missing. |
I've seen a panic in
most_popular_edge_color
, so I've made it more resilient.