From: Cristy Date: Wed, 13 Sep 2017 13:29:35 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.7-3~51 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d7eb8f2e504e7e39498e34cc00862929376c7241;p=imagemagick ... --- diff --git a/MagickWand/wand.c b/MagickWand/wand.c index 13537cbf1..c40b150c7 100644 --- a/MagickWand/wand.c +++ b/MagickWand/wand.c @@ -75,17 +75,20 @@ WandExport size_t AcquireWandId(void) { static size_t id = 0; - size_t wand_id = 0; + + size_t + wand_id; + if (wand_semaphore == (SemaphoreInfo *) NULL) ActivateSemaphoreInfo(&wand_semaphore); LockSemaphoreInfo(wand_semaphore); if (wand_ids == (SplayTreeInfo *) NULL) wand_ids=NewSplayTree((int (*)(const void *,const void *)) NULL, (void *(*)(void *)) NULL,(void *(*)(void *)) NULL); - id++; - (void) AddValueToSplayTree(wand_ids,(const void *) id,(const void *) id); + wand_id=id++; + (void) AddValueToSplayTree(wand_ids,(const void *) wand_id, + (const void *) wand_id); instantiate_wand=MagickTrue; - wand_id = id; UnlockSemaphoreInfo(wand_semaphore); return(wand_id); }