From dbfa37d9b82941b4f2a836b6043a25f09bcb5ba3 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sat, 14 May 2016 16:15:50 -0400 Subject: [PATCH] Don't call SetImageInfo() is delegate fails --- MagickCore/constitute.c | 8 ++++++-- MagickCore/delegate.c | 1 - MagickCore/magick.c | 2 +- config/delegates.xml.in | 14 ++++++-------- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/MagickCore/constitute.c b/MagickCore/constitute.c index 587cce80f..7723e1590 100644 --- a/MagickCore/constitute.c +++ b/MagickCore/constitute.c @@ -499,6 +499,9 @@ MagickExport Image *ReadImage(const ImageInfo *image_info, } else { + MagickBooleanType + status; + delegate_info=GetDelegateInfo(read_info->magick,(char *) NULL,exception); if (delegate_info == (const DelegateInfo *) NULL) { @@ -524,13 +527,14 @@ MagickExport Image *ReadImage(const ImageInfo *image_info, *read_info->filename='\0'; if (GetDelegateThreadSupport(delegate_info) == MagickFalse) LockSemaphoreInfo(delegate_info->semaphore); - (void) InvokeDelegate(read_info,image,read_info->magick,(char *) NULL, + status=InvokeDelegate(read_info,image,read_info->magick,(char *) NULL, exception); if (GetDelegateThreadSupport(delegate_info) == MagickFalse) UnlockSemaphoreInfo(delegate_info->semaphore); image=DestroyImageList(image); read_info->temporary=MagickTrue; - (void) SetImageInfo(read_info,0,exception); + if (status != MagickFalse) + (void) SetImageInfo(read_info,0,exception); magick_info=GetMagickInfo(read_info->magick,exception); if ((magick_info == (const MagickInfo *) NULL) || (GetImageDecoder(magick_info) == (DecodeImageHandler *) NULL)) diff --git a/MagickCore/delegate.c b/MagickCore/delegate.c index 68a8c350b..65695912e 100644 --- a/MagickCore/delegate.c +++ b/MagickCore/delegate.c @@ -1696,7 +1696,6 @@ MagickExport MagickBooleanType InvokeDelegate(ImageInfo *image_info, assert(image->signature == MagickCoreSignature); if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); - rights=ExecutePolicyRights; if (IsRightsAuthorized(DelegatePolicyDomain,rights,decode) == MagickFalse) { diff --git a/MagickCore/magick.c b/MagickCore/magick.c index cdd55d266..c999e9d83 100644 --- a/MagickCore/magick.c +++ b/MagickCore/magick.c @@ -1639,7 +1639,7 @@ MagickExport int SetMagickPrecision(const int precision) /* Precision reset, or it has not been set yet */ - magick_precision = MagickPrecision; + magick_precision=MagickPrecision; limit=GetEnvironmentValue("MAGICK_PRECISION"); if (limit == (char *) NULL) limit=GetPolicyValue("precision"); diff --git a/config/delegates.xml.in b/config/delegates.xml.in index 1eb9b9d72..913536143 100644 --- a/config/delegates.xml.in +++ b/config/delegates.xml.in @@ -17,16 +17,15 @@ decode="in_format" encode="out_format" - specify the rules for converting from in_format to out_format These - rules may be used to translate directly between formats. + specify the rules for converting from in_format to out_format. Use these + rules to translate directly between formats. Commands which specify only decode="in_format" specify the rules for converting from in_format to some format that - ImageMagick will automatically recognize. These rules are used to - decode formats. + ImageMagick automatically recognizes. Use these rules to decode formats. Commands which specify only @@ -34,8 +33,7 @@ specify the rules for an "encoder" which may accept any input format. - For delegates other than ps:*, pcl:*, and mpeg:* the substitution rules are - as follows: + The substitution rules are as follows: %a authentication passphrase %b image file size in bytes @@ -59,8 +57,8 @@ If stealth="True" the delegate is not listed in user requested "-list delegate" listings. These are typically special internal delegates. - If spawn="True" ImageMagick will not wait for the delegate to finish, nor will - it read any output image. + If spawn="True", ImageMagick does not wait for the delegate to finish, nor + will it read any output image. --> -- 2.40.0