From fcdc8aff767c55e9d514ae155d3719b58146cb4e Mon Sep 17 00:00:00 2001 From: Minje Ahn Date: Mon, 30 Mar 2020 17:21:20 +0900 Subject: [PATCH] Use DestroyImageList instead of DestroyImage If input image type is agif, returned Image structure is list. Change-Id: I16c3b1cbde6048c45cad5ff07ea51d9dfa52dbcc Signed-off-by: Minje Ahn --- magick/mm_util_magick.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/magick/mm_util_magick.c b/magick/mm_util_magick.c index 42363f0..e9bb9cb 100644 --- a/magick/mm_util_magick.c +++ b/magick/mm_util_magick.c @@ -79,11 +79,8 @@ static void __mm_util_init(ExceptionInfo *exception) static void __mm_util_finalize(Image *image_1, Image *image_2, ImageInfo *imageInfo, ExceptionInfo *exception) { - if (image_1 != NULL) - DestroyImage(image_1); - - if (image_2 != NULL) - DestroyImage(image_2); + DestroyImageList(image_1); + DestroyImageList(image_2); if (imageInfo != NULL) DestroyImageInfo(imageInfo); @@ -214,8 +211,7 @@ static Image * __mm_util_resize_image(Image *image, unsigned int width, unsigned CatchException(&exception); } - if (_sampled_image != NULL) - DestroyImage(_sampled_image); + DestroyImageList(_sampled_image); DestroyExceptionInfo(&exception); -- 2.34.1