Skip to content

Conversation

@mateoconlechuga
Copy link
Contributor

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.

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`. Signed-off-by: mateoconlechuga <matthewwaltzis@gmail.com>
@mateoconlechuga
Copy link
Contributor Author

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

if (!img->temp_row) return NULL;
}

img->temp_f_row = NULL;
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand why is it nulled here. If it was null already (as should have been from the init earlier) then it's unnecessary. If it wasn't null, that's a leak.

@kornelski
Copy link
Member

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

@kornelski kornelski closed this Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants