]> granicus.if.org Git - imagemagick/commitdiff
Proper fix...
authordirk <dirk@git.imagemagick.org>
Sun, 26 Jun 2016 09:02:34 +0000 (11:02 +0200)
committerdirk <dirk@git.imagemagick.org>
Sun, 26 Jun 2016 09:02:34 +0000 (11:02 +0200)
MagickCore/nt-base.c

index 8ab1116c7f3695bf2e5ef685d557cc52a98d609b..16089762277e489ca8deaefd49c1aec43af37ed1 100644 (file)
@@ -1380,16 +1380,18 @@ MagickPrivate int NTGhostscriptEXE(char *path,int length)
       if (*program == '\0')
         {
           if (NTGhostscriptGetString("GS_DLL",&is_64_bit_version,program,
-              sizeof(program)) != FALSE)
+              sizeof(program)) == FALSE)
             {
-              p=strrchr(program,'\\');
-              if (p != (char *) NULL)
-                {
-                  p++;
-                  *p='\0';
-                  (void) ConcatenateMagickString(program,is_64_bit_version ?
-                    "gswin64c.exe" : "gswin32c.exe",sizeof(program));
-                }
+              UnlockSemaphoreInfo(ghost_semaphore);
+              return(FALSE);
+            }
+          p=strrchr(program,'\\');
+          if (p != (char *) NULL)
+            {
+              p++;
+              *p='\0';
+              (void) ConcatenateMagickString(program,is_64_bit_version ?
+                "gswin64c.exe" : "gswin32c.exe",sizeof(program));
             }
         }
       UnlockSemaphoreInfo(ghost_semaphore);