From 0a19ed89da833569e014a05e2077a0819a91e5aa Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Sun, 5 Aug 2012 15:12:03 +0200 Subject: Make sure images are freed upon loading error There was a call to fz_drop_image() in the error handling code, however the fz_storable freeing function was not yet set which meant that the image was not freed. Instead call pdf_free_image() to free the image. --- pdf/pdf_image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdf/pdf_image.c b/pdf/pdf_image.c index 58a17ed0..873aeb08 100644 --- a/pdf/pdf_image.c +++ b/pdf/pdf_image.c @@ -456,7 +456,7 @@ pdf_load_image_imp(pdf_document *xref, pdf_obj *rdb, pdf_obj *dict, fz_stream *c } fz_catch(ctx) { - fz_drop_image(ctx, &image->base); + pdf_free_image(ctx, (fz_storable *) image); fz_rethrow(ctx); } return image; -- cgit v1.2.3