libimagequant
libimagequant copied to clipboard
Big resolution images crash the library
I'm trying to process a quite large PNG (7680 × 4320, ~100Mb) but the library seems to not be able to handle it, panicking with
thread 'main' panicked at 'attempt to add with overflow' on src/hist.rs:206:34.
The issue is quite easy to reproduce by running the provided example and just setting
let width = 5000;
let height = 5000;
or anything bigger than that. Crashes all the time on my machine.
Additional info:
- imagequant 4.0.2
- macOS 12.5.1 (MacbookPro 2017, Intel chipset)
- Rust 1.63