From: Dirk Lemstra Date: Sat, 16 Sep 2017 07:27:28 +0000 (+0200) Subject: Added extra check to make sure the magick_list is properly initialized. X-Git-Tag: 7.0.7-3~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2453a37a7205c487184aa28f055cebc19b9087ff;p=imagemagick Added extra check to make sure the magick_list is properly initialized. --- diff --git a/MagickCore/magick.c b/MagickCore/magick.c index 7f2b23415..1c590f9ad 100644 --- a/MagickCore/magick.c +++ b/MagickCore/magick.c @@ -125,7 +125,8 @@ static SplayTreeInfo static volatile MagickBooleanType instantiate_magickcore = MagickFalse, - magickcore_signal_in_progress = MagickFalse; + magickcore_signal_in_progress = MagickFalse, + magick_list_initialized = MagickFalse; /* Forward declarations. @@ -1019,12 +1020,12 @@ static void *DestroyMagickNode(void *magick_info) static MagickBooleanType IsMagickTreeInstantiated(ExceptionInfo *exception) { - if (magick_list == (SplayTreeInfo *) NULL) + if (magick_list_initialized == MagickFalse) { if (magick_semaphore == (SemaphoreInfo *) NULL) ActivateSemaphoreInfo(&magick_semaphore); LockSemaphoreInfo(magick_semaphore); - if (magick_list == (SplayTreeInfo *) NULL) + if (magick_list_initialized == MagickFalse) { magick_list=NewSplayTree(CompareSplayTreeString,(void *(*)(void *)) NULL,DestroyMagickNode); @@ -1037,6 +1038,7 @@ static MagickBooleanType IsMagickTreeInstantiated(ExceptionInfo *exception) #if !defined(MAGICKCORE_BUILD_MODULES) RegisterStaticModules(); #endif + magick_list_initialized=MagickTrue; } UnlockSemaphoreInfo(magick_semaphore); }