diff --git a/pipi/codec.c b/pipi/codec.c index 66d9a43..2b31d31 100644 --- a/pipi/codec.c +++ b/pipi/codec.c @@ -51,6 +51,12 @@ pipi_image_t *pipi_new(int width, int height) void pipi_free(pipi_image_t *img) { + unsigned int i; + + for(i = 0; i < PIPI_PIXELS_MAX; i++) + if(i != img->codec_format && img->p[i].pixels) + free(img->p[i].pixels); + #if USE_SDL return pipi_free_sdl(img); #elif USE_IMLIB2