]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 16 Mar 2014 00:37:58 +0000 (00:37 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 16 Mar 2014 00:37:58 +0000 (00:37 +0000)
13 files changed:
MagickCore/coder.c
MagickCore/color.c
MagickCore/configure.c
MagickCore/delegate.c
MagickCore/locale.c
MagickCore/log.c
MagickCore/magic.c
MagickCore/magick.c
MagickCore/mime.c
MagickCore/module.c
MagickCore/policy.c
MagickCore/type.c
PerlMagick/Magick.xs

index f4def8f17ae6dbaf2a75530268c800c89b0d9724..9db3547a802cafe649c74d901b17bbb145a40915 100644 (file)
@@ -324,15 +324,23 @@ MagickPrivate void CoderComponentTerminus(void)
 MagickExport const CoderInfo *GetCoderInfo(const char *name,
   ExceptionInfo *exception)
 {
+  const CoderInfo
+    *coder_info;
+
   assert(exception != (ExceptionInfo *) NULL);
   if (IsCoderTreeInstantiated(exception) == MagickFalse)
     return((const CoderInfo *) NULL);
+  LockSemaphoreInfo(coder_semaphore);
   if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
     {
       ResetSplayTreeIterator(coder_list);
-      return((const CoderInfo *) GetNextValueInSplayTree(coder_list));
+      coder_info=(const CoderInfo *) GetNextValueInSplayTree(coder_list);
+      UnlockSemaphoreInfo(coder_semaphore);
+      return(coder_info);
     }
-  return((const CoderInfo *) GetValueFromSplayTree(coder_list,name));
+  coder_info=(const CoderInfo *) GetValueFromSplayTree(coder_list,name);
+  UnlockSemaphoreInfo(coder_semaphore);
+  return(coder_info);
 }
 \f
 /*
index ddf673aab0fc7eba4528a562072a8f80d986857b..d182058fc9a3e57638109dfb801867d64778cd72 100644 (file)
@@ -912,12 +912,12 @@ MagickExport const ColorInfo *GetColorCompliance(const char *name,
   if (color_list == (LinkedListInfo *) NULL)
     if (IfMagickFalse(IsColorListInstantiated(exception)))
       return((const ColorInfo *) NULL);
-  if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
-    return((const ColorInfo *) GetValueFromLinkedList(color_list,0));
   /*
     Strip names of whitespace.
   */
-  (void) CopyMagickString(colorname,name,MaxTextExtent);
+  *colorname='\0';
+  if (name != (const char *) NULL)
+    (void) CopyMagickString(colorname,name,MaxTextExtent);
   for (q=colorname; *q != '\0'; q++)
   {
     if (isspace((int) ((unsigned char) *q)) == 0)
@@ -931,6 +931,11 @@ MagickExport const ColorInfo *GetColorCompliance(const char *name,
   LockSemaphoreInfo(color_semaphore);
   ResetLinkedListIterator(color_list);
   p=(const ColorInfo *) GetNextValueInLinkedList(color_list);
+  if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
+    {
+      UnlockSemaphoreInfo(color_semaphore);
+      return(p);
+    }
   while (p != (const ColorInfo *) NULL)
   {
     if (((p->compliance & compliance) != 0) &&
index b102d2cbda9883a097dd4bd3eba79d678985d03d..5985d1bbc83f8763028873f8673f7008c983c1e6 100644 (file)
@@ -266,14 +266,17 @@ MagickExport const ConfigureInfo *GetConfigureInfo(const char *name,
   assert(exception != (ExceptionInfo *) NULL);
   if (IsConfigureListInstantiated(exception) == MagickFalse)
     return((const ConfigureInfo *) NULL);
-  if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
-    return((const ConfigureInfo *) GetValueFromLinkedList(configure_list,0));
   /*
     Search for configure tag.
   */
   LockSemaphoreInfo(configure_semaphore);
   ResetLinkedListIterator(configure_list);
   p=(const ConfigureInfo *) GetNextValueInLinkedList(configure_list);
+  if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
+    {
+      UnlockSemaphoreInfo(configure_semaphore);
+      return(p);
+    }
   while (p != (const ConfigureInfo *) NULL)
   {
     if (LocaleCompare(name,p->name) == 0)
index 581698a46abef8a36bb4e5876d3493b813c65a4b..ce6d84e7d4b58d0d6135ef960287b4b69a2db68b 100644 (file)
@@ -369,14 +369,17 @@ MagickExport const DelegateInfo *GetDelegateInfo(const char *decode,
   if (delegate_list == (LinkedListInfo *) NULL)
     if( IfMagickFalse(IsDelegateListInstantiated(exception)) )
       return((const DelegateInfo *) NULL);
-  if ((LocaleCompare(decode,"*") == 0) && (LocaleCompare(encode,"*") == 0))
-    return((const DelegateInfo *) GetValueFromLinkedList(delegate_list,0));
   /*
     Search for named delegate.
   */
   LockSemaphoreInfo(delegate_semaphore);
   ResetLinkedListIterator(delegate_list);
   p=(const DelegateInfo *) GetNextValueInLinkedList(delegate_list);
+  if ((LocaleCompare(decode,"*") == 0) && (LocaleCompare(encode,"*") == 0))
+    {
+      UnlockSemaphoreInfo(delegate_semaphore);
+      return(p);
+    }
   while (p != (const DelegateInfo *) NULL)
   {
     if (p->mode > 0)
index e336f4519a43219147b7d1a9f9d867219a5c61f9..2f1452c584b0f63e900440731ffdfcbc453517b7 100644 (file)
@@ -420,15 +420,23 @@ MagickExport ssize_t FormatLocaleString(char *restrict string,
 MagickExport const LocaleInfo *GetLocaleInfo_(const char *tag,
   ExceptionInfo *exception)
 {
+  const LocaleInfo
+    *locale_info;
+
   assert(exception != (ExceptionInfo *) NULL);
   if (IsLocaleTreeInstantiated(exception) == MagickFalse)
     return((const LocaleInfo *) NULL);
+  LockSemaphoreInfo(locale_semaphore);
   if ((tag == (const char *) NULL) || (LocaleCompare(tag,"*") == 0))
     {
       ResetSplayTreeIterator(locale_list);
-      return((const LocaleInfo *) GetNextValueInSplayTree(locale_list));
+      locale_info=(const LocaleInfo *) GetNextValueInSplayTree(locale_list);
+      UnlockSemaphoreInfo(locale_semaphore);
+      return(locale_info);
     }
-  return((const LocaleInfo *) GetValueFromSplayTree(locale_list,tag));
+  locale_info=(const LocaleInfo *) GetValueFromSplayTree(locale_list,tag);
+  UnlockSemaphoreInfo(locale_semaphore);
+  return(locale_info);
 }
 \f
 /*
index 889caedf8939e0135c11e5e578324087aabdf0df..0ebd2b816c3f8e778bce5272f6bb1aaa8b3f83ed 100644 (file)
@@ -184,6 +184,7 @@ static LinkedListInfo
   *log_list = (LinkedListInfo *) NULL;
 
 static SemaphoreInfo
+  *event_semaphore = (SemaphoreInfo *) NULL,
   *log_semaphore = (SemaphoreInfo *) NULL;
 \f
 /*
@@ -273,14 +274,17 @@ static LogInfo *GetLogInfo(const char *name,ExceptionInfo *exception)
   assert(exception != (ExceptionInfo *) NULL);
   if (IsLogListInstantiated(exception) == MagickFalse)
     return((LogInfo *) NULL);
-  if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
-    return((LogInfo *) GetValueFromLinkedList(log_list,0));
   /*
     Search for log tag.
   */
   LockSemaphoreInfo(log_semaphore);
   ResetLinkedListIterator(log_list);
   p=(LogInfo *) GetNextValueInLinkedList(log_list);
+  if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
+    {
+      UnlockSemaphoreInfo(log_semaphore);
+      return(p);
+    }
   while (p != (LogInfo *) NULL)
   {
     if (LocaleCompare(name,p->name) == 0)
index 77864e958dfd241e9698f63a872dc5b58c7a1539..c70552ffb36a687011e6d1244f8c8387255497bc 100644 (file)
@@ -254,8 +254,6 @@ MagickExport const MagicInfo *GetMagicInfo(const unsigned char *magic,
   assert(exception != (ExceptionInfo *) NULL);
   if (IsMagicListInstantiated(exception) == MagickFalse)
     return((const MagicInfo *) NULL);
-  if (magic == (const unsigned char *) NULL)
-    return((const MagicInfo *) GetValueFromLinkedList(magic_list,0));
   if (length == 0)
     return((const MagicInfo *) NULL);
   /*
@@ -264,6 +262,11 @@ MagickExport const MagicInfo *GetMagicInfo(const unsigned char *magic,
   LockSemaphoreInfo(magic_semaphore);
   ResetLinkedListIterator(magic_list);
   p=(const MagicInfo *) GetNextValueInLinkedList(magic_list);
+  if (magic == (const unsigned char *) NULL)
+    {
+      UnlockSemaphoreInfo(magic_semaphore);
+      return(p);
+    }
   while (p != (const MagicInfo *) NULL)
   {
     assert(p->offset >= 0);
index 9d1ef3c86da64e2b20157885dc6f0bb06c9b7cda..da6528fc8d8427d47a4e43223d9b7e1181e4963e 100644 (file)
@@ -414,24 +414,23 @@ MagickExport const MagickInfo *GetMagickInfo(const char *name,
   assert(exception != (ExceptionInfo *) NULL);
   if (IsMagickTreeInstantiated(exception) == MagickFalse)
     return((const MagickInfo *) NULL);
+  /*
+    Find name in list.
+  */
+  LockSemaphoreInfo(magick_semaphore);
+  ResetSplayTreeIterator(magick_list);
+  p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
   if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
     {
 #if defined(MAGICKCORE_MODULES_SUPPORT)
       if (LocaleCompare(name,"*") == 0)
         (void) OpenModules(exception);
 #endif
-      LockSemaphoreInfo(magick_semaphore);
       ResetSplayTreeIterator(magick_list);
       p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
       UnlockSemaphoreInfo(magick_semaphore);
       return(p);
     }
-  /*
-    Find name in list.
-  */
-  LockSemaphoreInfo(magick_semaphore);
-  ResetSplayTreeIterator(magick_list);
-  p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
   while (p != (const MagickInfo *) NULL)
   {
     if (LocaleCompare(p->name,name) == 0)
index 414e8f2ae89fb1f9d0ec7e2743c8aab3b081a818..56fef380c4e357297aa8ed7100dbd6890de90fda 100644 (file)
@@ -320,7 +320,7 @@ MagickExport const MimeInfo *GetMimeInfo(const char *filename,
     (void) InsertValueInLinkedList(mime_list,0,
       RemoveElementByValueFromLinkedList(mime_list,p));
   UnlockSemaphoreInfo(mime_semaphore);
-  return(mime_info);
+  return(p);
 }
 \f
 /*
index 611d2d626dd16d179930fb1aafa8451988ed4479..4051ddd77da7d48a2de32ee1244c5f24170db57e 100644 (file)
@@ -215,24 +215,26 @@ MagickExport void DestroyModuleList(void)
 */
 MagickExport ModuleInfo *GetModuleInfo(const char *tag,ExceptionInfo *exception)
 {
+  ModuleInfo
+    *module_info;
+
   if (IsModuleTreeInstantiated(exception) == MagickFalse)
     return((ModuleInfo *) NULL);
+  LockSemaphoreInfo(module_semaphore);
+  ResetSplayTreeIterator(module_list);
   if ((tag == (const char *) NULL) || (LocaleCompare(tag,"*") == 0))
     {
-      ModuleInfo
-        *p;
-
 #if defined(MAGICKCORE_MODULES_SUPPORT)
       if (LocaleCompare(tag,"*") == 0)
         (void) OpenModules(exception);
 #endif
-      LockSemaphoreInfo(module_semaphore);
-      ResetSplayTreeIterator(module_list);
-      p=(ModuleInfo *) GetNextValueInSplayTree(module_list);
+      module_info=(ModuleInfo *) GetNextValueInSplayTree(module_list);
       UnlockSemaphoreInfo(module_semaphore);
-      return(p);
+      return(module_info);
     }
-  return((ModuleInfo *) GetValueFromSplayTree(module_list,tag));
+  module_info=(ModuleInfo *) GetValueFromSplayTree(module_list,tag);
+  UnlockSemaphoreInfo(module_semaphore);
+  return(module_info);
 }
 \f
 /*
index 20105058507e468d66d968bfd0ad8b5598563974..943a815597b81d6d4c01b84d8e5b02a933270649 100644 (file)
@@ -171,12 +171,12 @@ static PolicyInfo *GetPolicyInfo(const char *name,ExceptionInfo *exception)
   assert(exception != (ExceptionInfo *) NULL);
   if (IsPolicyListInstantiated(exception) == MagickFalse)
     return((PolicyInfo *) NULL);
-  if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
-    return((PolicyInfo *) GetValueFromLinkedList(policy_list,0));
   /*
     Strip names of whitespace.
   */
-  (void) CopyMagickString(policyname,name,MaxTextExtent);
+  *policyname='\0';
+  if (name != (const char *) NULL)
+    (void) CopyMagickString(policyname,name,MaxTextExtent);
   for (q=policyname; *q != '\0'; q++)
   {
     if (isspace((int) ((unsigned char) *q)) == 0)
@@ -190,6 +190,11 @@ static PolicyInfo *GetPolicyInfo(const char *name,ExceptionInfo *exception)
   LockSemaphoreInfo(policy_semaphore);
   ResetLinkedListIterator(policy_list);
   p=(PolicyInfo *) GetNextValueInLinkedList(policy_list);
+  if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
+    {
+      UnlockSemaphoreInfo(policy_semaphore);
+      return(p);
+    }
   while (p != (PolicyInfo *) NULL)
   {
     if (LocaleCompare(policyname,p->name) == 0)
index 59e5eb9c83fba6b866cd4bb2ddd7e9fcfb317523..b727289d16502d97f92c76d98ccf4ae8cbadd0c6 100644 (file)
@@ -158,12 +158,17 @@ MagickExport const TypeInfo *GetTypeInfo(const char *name,
   assert(exception != (ExceptionInfo *) NULL);
   if (IsTypeTreeInstantiated(exception) == MagickFalse)
     return((const TypeInfo *) NULL);
+  LockSemaphoreInfo(type_semaphore);
   if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
     {
       ResetSplayTreeIterator(type_list);
-      return((const TypeInfo *) GetNextValueInSplayTree(type_list));
+      type_info=(const TypeInfo *) GetNextValueInSplayTree(type_list);
+      UnlockSemaphoreInfo(type_semaphore);
+      return(type_info);
     }
-  return((const TypeInfo *) GetValueFromSplayTree(type_list,name));
+  type_info=(const TypeInfo *) GetValueFromSplayTree(type_list,name);
+  UnlockSemaphoreInfo(type_semaphore);
+  return(type_info);
 }
 \f
 /*
index 074779711294cc901b314ae20d75ad3e42e18723..1d73b70dbc9759d712c148e38cc4a10298ada378 100644 (file)
@@ -10001,7 +10001,7 @@ Mogrify(ref,...)
           if (attribute_flag[2] != 0)
             channel=(ChannelType) argument_list[2].integer_reference;
           channel_mask=SetImageChannelMask(image,channel);
-          image=RadialBlurImage(image,geometry_info.rho,exception);
+          image=RotationalBlurImage(image,geometry_info.rho,exception);
           if (image != (Image *) NULL)
             (void) SetImageChannelMask(image,channel_mask);
           break;