From 962d519ae3e64c527e9f369227a763b44ea3b18f Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Thu, 30 Aug 2018 11:55:46 +0500 Subject: [PATCH] MagickCore/constitute.c: resolve possible null pointer dereference found by cppcheck [MagickCore/constitute.c:1074] -> [MagickCore/constitute.c:1071]: (warning) Either the condition 'image!=(Image*)NULL' is redundant or there is possible null pointer dereference: image. --- MagickCore/constitute.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MagickCore/constitute.c b/MagickCore/constitute.c index 637cb1afb..0bcd2140a 100644 --- a/MagickCore/constitute.c +++ b/MagickCore/constitute.c @@ -1068,10 +1068,10 @@ MagickExport MagickBooleanType WriteImage(const ImageInfo *image_info, */ assert(image_info != (ImageInfo *) NULL); assert(image_info->signature == MagickCoreSignature); + assert(image != (Image *) NULL); if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", image_info->filename); - assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); assert(exception != (ExceptionInfo *) NULL); sans_exception=AcquireExceptionInfo(); -- 2.40.0