From: cristy Date: Sun, 16 Mar 2014 00:37:58 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~2577 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=49d4d2247a71eab1c5c56bae91a5f9d0fcc4475c;p=imagemagick --- diff --git a/MagickCore/coder.c b/MagickCore/coder.c index f4def8f17..9db3547a8 100644 --- a/MagickCore/coder.c +++ b/MagickCore/coder.c @@ -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); } /* diff --git a/MagickCore/color.c b/MagickCore/color.c index ddf673aab..d182058fc 100644 --- a/MagickCore/color.c +++ b/MagickCore/color.c @@ -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) && diff --git a/MagickCore/configure.c b/MagickCore/configure.c index b102d2cbd..5985d1bbc 100644 --- a/MagickCore/configure.c +++ b/MagickCore/configure.c @@ -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) diff --git a/MagickCore/delegate.c b/MagickCore/delegate.c index 581698a46..ce6d84e7d 100644 --- a/MagickCore/delegate.c +++ b/MagickCore/delegate.c @@ -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) diff --git a/MagickCore/locale.c b/MagickCore/locale.c index e336f4519..2f1452c58 100644 --- a/MagickCore/locale.c +++ b/MagickCore/locale.c @@ -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); } /* diff --git a/MagickCore/log.c b/MagickCore/log.c index 889caedf8..0ebd2b816 100644 --- a/MagickCore/log.c +++ b/MagickCore/log.c @@ -184,6 +184,7 @@ static LinkedListInfo *log_list = (LinkedListInfo *) NULL; static SemaphoreInfo + *event_semaphore = (SemaphoreInfo *) NULL, *log_semaphore = (SemaphoreInfo *) NULL; /* @@ -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) diff --git a/MagickCore/magic.c b/MagickCore/magic.c index 77864e958..c70552ffb 100644 --- a/MagickCore/magic.c +++ b/MagickCore/magic.c @@ -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); diff --git a/MagickCore/magick.c b/MagickCore/magick.c index 9d1ef3c86..da6528fc8 100644 --- a/MagickCore/magick.c +++ b/MagickCore/magick.c @@ -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) diff --git a/MagickCore/mime.c b/MagickCore/mime.c index 414e8f2ae..56fef380c 100644 --- a/MagickCore/mime.c +++ b/MagickCore/mime.c @@ -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); } /* diff --git a/MagickCore/module.c b/MagickCore/module.c index 611d2d626..4051ddd77 100644 --- a/MagickCore/module.c +++ b/MagickCore/module.c @@ -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); } /* diff --git a/MagickCore/policy.c b/MagickCore/policy.c index 201050585..943a81559 100644 --- a/MagickCore/policy.c +++ b/MagickCore/policy.c @@ -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) diff --git a/MagickCore/type.c b/MagickCore/type.c index 59e5eb9c8..b727289d1 100644 --- a/MagickCore/type.c +++ b/MagickCore/type.c @@ -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); } /* diff --git a/PerlMagick/Magick.xs b/PerlMagick/Magick.xs index 074779711..1d73b70db 100644 --- a/PerlMagick/Magick.xs +++ b/PerlMagick/Magick.xs @@ -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;