From 8af4ce45710dba703410d05318215a0de9aa0f19 Mon Sep 17 00:00:00 2001 From: slmistry Date: Mon, 14 Sep 2015 17:38:11 +0100 Subject: [PATCH] Revert change and let user choose appropriate "image_destroy" function to prevent memory leaks. Check return value from opj_copy_image_header. --- src/lib/openjp2/image.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/openjp2/image.c b/src/lib/openjp2/image.c index 17d4ffc2..d4ad966b 100644 --- a/src/lib/openjp2/image.c +++ b/src/lib/openjp2/image.c @@ -102,9 +102,9 @@ OPJ_API opj_image_t* OPJ_CALLCONV opj_manager_image_create(opj_manager_t manager void OPJ_CALLCONV opj_image_destroy(opj_image_t *image) { - if (image) { - opj_manager_image_destroy(image->m_manager, image); - } + opj_manager_t l_manager = opj_manager_get_global_manager(); + + opj_manager_image_destroy(l_manager, image); } OPJ_API void OPJ_CALLCONV opj_manager_image_destroy(opj_manager_t manager, opj_image_t *image)