ImageOptim / libimagequant

Palette quantization library that powers pngquant and other PNG optimizers
https://pngquant.org/lib
Other
780 stars 132 forks source link

fix memory leak #99

Closed mateoconlechuga closed 2 years ago

mateoconlechuga commented 2 years ago

this function leaked memory when the standard liq_image_create_rgba/liq_quantize_image/liq_write_remapped_image combo is used on large images (or forced to use conserved memory).

fixed by checking if the temporary array is already allocated by either liq_image_create_rgba and liq_write_remapped_image.

mateoconlechuga commented 2 years ago

I realize that not many people are still using the 2.x branch but I figured may as well push this :)

kornelski commented 2 years ago

Thanks for reporting this. I've fixed it in 113567c1874af0515e2f27284ae4710d0a097b26