Skip to content

Commit 0374db5

Browse files
web-flowMolotovCherry
authored andcommitted
Update ImageMagick from 7.1.1-16 -> 7.1.1-17
1 parent 7e97b6d commit 0374db5

File tree

643 files changed

+77
-42
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

643 files changed

+77
-42
lines changed

Android.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ OPENCL_INCLUDE_PATH := $(OPENCL_PATH)/qualcomm/include
3030

3131
LTDL_LIB_PATH := $(LOCAL_PATH)/libltdl-2.4.6
3232

33-
IMAGE_MAGICK_BASEDIR := ImageMagick-7.1.1-16
33+
IMAGE_MAGICK_BASEDIR := ImageMagick-7.1.1-17
3434
IMAGE_MAGICK := $(LOCAL_PATH)/$(IMAGE_MAGICK_BASEDIR)
3535

3636
JPEG_LIB_PATH := $(LOCAL_PATH)/libjpeg-turbo-2.0.2
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

ImageMagick-7.1.1-16/MagickCore/policy.c ImageMagick-7.1.1-17/MagickCore/policy.c

+59-18
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232
% %
3333
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3434
%
35-
% We use linked-lists because splay-trees do not currently support duplicate
36-
% key / value pairs (.e.g X11 green compliance and SVG green compliance).
37-
%
3835
*/
3936

4037
/*
@@ -67,6 +64,10 @@
6764
#include "MagickCore/utility-private.h"
6865
#include "MagickCore/xml-tree.h"
6966
#include "MagickCore/xml-tree-private.h"
67+
#if defined(MAGICKCORE_XML_DELEGATE)
68+
# include <libxml/parser.h>
69+
# include <libxml/tree.h>
70+
#endif
7071

7172
/*
7273
Define declarations.
@@ -174,7 +175,7 @@ static LinkedListInfo *AcquirePolicyCache(const char *filename,
174175
LinkedListInfo
175176
*cache;
176177

177-
MagickStatusType
178+
MagickBooleanType
178179
status;
179180

180181
ssize_t
@@ -186,9 +187,11 @@ static LinkedListInfo *AcquirePolicyCache(const char *filename,
186187
cache=NewLinkedList(0);
187188
status=MagickTrue;
188189
#if MAGICKCORE_ZERO_CONFIGURATION_SUPPORT
189-
(void) filename;
190+
magick_unreferenced(filename);
190191
status=LoadPolicyCache(cache,ZeroConfigurationPolicy,"[zero-configuration]",0,
191192
exception);
193+
if (status == MagickFalse)
194+
CatchException(exception);
192195
#else
193196
{
194197
const StringInfo
@@ -201,8 +204,10 @@ static LinkedListInfo *AcquirePolicyCache(const char *filename,
201204
option=(const StringInfo *) GetNextValueInLinkedList(options);
202205
while (option != (const StringInfo *) NULL)
203206
{
204-
status&=(MagickStatusType) LoadPolicyCache(cache,(const char *)
205-
GetStringInfoDatum(option),GetStringInfoPath(option),0,exception);
207+
status=LoadPolicyCache(cache,(const char *) GetStringInfoDatum(option),
208+
GetStringInfoPath(option),0,exception);
209+
if (status == MagickFalse)
210+
CatchException(exception);
206211
option=(const StringInfo *) GetNextValueInLinkedList(options);
207212
}
208213
options=DestroyConfigureOptions(options);
@@ -213,19 +218,20 @@ static LinkedListInfo *AcquirePolicyCache(const char *filename,
213218
*/
214219
for (i=0; i < (ssize_t) (sizeof(PolicyMap)/sizeof(*PolicyMap)); i++)
215220
{
216-
PolicyInfo
217-
*policy_info;
218-
219221
const PolicyMapInfo
220222
*p;
221223

224+
PolicyInfo
225+
*policy_info;
226+
222227
p=PolicyMap+i;
223228
policy_info=(PolicyInfo *) AcquireMagickMemory(sizeof(*policy_info));
224229
if (policy_info == (PolicyInfo *) NULL)
225230
{
226231
(void) ThrowMagickException(exception,GetMagickModule(),
227232
ResourceLimitError,"MemoryAllocationFailed","`%s'",
228233
p->name == (char *) NULL ? "" : p->name);
234+
CatchException(exception);
229235
continue;
230236
}
231237
(void) memset(policy_info,0,sizeof(*policy_info));
@@ -237,10 +243,14 @@ static LinkedListInfo *AcquirePolicyCache(const char *filename,
237243
policy_info->value=(char *) p->value;
238244
policy_info->exempt=MagickTrue;
239245
policy_info->signature=MagickCoreSignature;
240-
status&=(MagickStatusType) AppendValueToLinkedList(cache,policy_info);
246+
status=AppendValueToLinkedList(cache,policy_info);
241247
if (status == MagickFalse)
242-
(void) ThrowMagickException(exception,GetMagickModule(),
243-
ResourceLimitError,"MemoryAllocationFailed","`%s'",policy_info->name);
248+
{
249+
(void) ThrowMagickException(exception,GetMagickModule(),
250+
ResourceLimitError,"MemoryAllocationFailed","`%s'",
251+
p->name == (char *) NULL ? "" : p->name);
252+
CatchException(exception);
253+
}
244254
}
245255
return(cache);
246256
}
@@ -804,8 +814,9 @@ MagickExport MagickBooleanType ListPolicyInfo(FILE *file,
804814
% o exception: return any errors or warnings in this structure.
805815
%
806816
*/
807-
static MagickBooleanType LoadPolicyCache(LinkedListInfo *cache,const char *xml,
808-
const char *filename,const size_t depth,ExceptionInfo *exception)
817+
static MagickBooleanType LoadPolicyCache(LinkedListInfo *cache,
818+
const char *policy,const char *filename,const size_t depth,
819+
ExceptionInfo *exception)
809820
{
810821
char
811822
keyword[MagickPathExtent],
@@ -828,13 +839,13 @@ static MagickBooleanType LoadPolicyCache(LinkedListInfo *cache,const char *xml,
828839
*/
829840
(void) LogMagickEvent(ConfigureEvent,GetMagickModule(),
830841
"Loading policy file \"%s\" ...",filename);
831-
if (xml == (char *) NULL)
842+
if (policy == (char *) NULL)
832843
return(MagickFalse);
833844
status=MagickTrue;
834845
policy_info=(PolicyInfo *) NULL;
835-
token=AcquirePolicyString(xml,MagickPathExtent);
846+
token=AcquirePolicyString(policy,MagickPathExtent);
836847
extent=strlen(token)+MagickPathExtent;
837-
for (q=(const char *) xml; *q != '\0'; )
848+
for (q=policy; *q != '\0'; )
838849
{
839850
/*
840851
Interpret XML.
@@ -1108,6 +1119,34 @@ MagickPrivate void PolicyComponentTerminus(void)
11081119
% o exception: return any errors or warnings in this structure.
11091120
%
11101121
*/
1122+
1123+
static MagickBooleanType ValidateSecurityPolicy(const char *policy,
1124+
const char *url,ExceptionInfo *exception)
1125+
{
1126+
#if defined(MAGICKCORE_XML_DELEGATE)
1127+
xmlDocPtr
1128+
document;
1129+
1130+
/*
1131+
Parse security policy.
1132+
*/
1133+
document=xmlReadMemory(policy,(int) strlen(policy),url,NULL,
1134+
XML_PARSE_NOERROR | XML_PARSE_NOWARNING);
1135+
if (document == (xmlDocPtr) NULL)
1136+
{
1137+
(void) ThrowMagickException(exception,GetMagickModule(),ConfigureError,
1138+
"PolicyValidationException","'%s'",url);
1139+
return(MagickFalse);
1140+
}
1141+
xmlFreeDoc(document);
1142+
#else
1143+
(void) policy;
1144+
(void) url;
1145+
(void) exception;
1146+
#endif
1147+
return(MagickTrue);
1148+
}
1149+
11111150
MagickExport MagickBooleanType SetMagickSecurityPolicy(const char *policy,
11121151
ExceptionInfo *exception)
11131152
{
@@ -1120,6 +1159,8 @@ MagickExport MagickBooleanType SetMagickSecurityPolicy(const char *policy,
11201159
assert(exception != (ExceptionInfo *) NULL);
11211160
if (policy == (const char *) NULL)
11221161
return(MagickFalse);
1162+
if (ValidateSecurityPolicy(policy,PolicyFilename,exception) == MagickFalse)
1163+
return(MagickFalse);
11231164
if (IsPolicyCacheInstantiated(exception) == MagickFalse)
11241165
return(MagickFalse);
11251166
LockSemaphoreInfo(policy_semaphore);

ImageMagick-7.1.1-16/MagickCore/profile.c ImageMagick-7.1.1-17/MagickCore/profile.c

+7-13
Original file line numberDiff line numberDiff line change
@@ -1914,15 +1914,15 @@ static void PatchCorruptProfile(const char *name,StringInfo *profile)
19141914
}
19151915
}
19161916

1917-
#if defined(MAGICKCORE_XML_DELEGATE)
19181917
static MagickBooleanType ValidateXMPProfile(Image *image,
19191918
const StringInfo *profile,ExceptionInfo *exception)
19201919
{
1920+
#if defined(MAGICKCORE_XML_DELEGATE)
19211921
xmlDocPtr
19221922
document;
19231923

19241924
/*
1925-
Parse XML profile.
1925+
Validate XMP profile.
19261926
*/
19271927
document=xmlReadMemory((const char *) GetStringInfoDatum(profile),(int)
19281928
GetStringInfoLength(profile),"xmp.xml",NULL,XML_PARSE_NOERROR |
@@ -1934,19 +1934,13 @@ static MagickBooleanType ValidateXMPProfile(Image *image,
19341934
return(MagickFalse);
19351935
}
19361936
xmlFreeDoc(document);
1937-
return(MagickTrue);
1938-
}
19391937
#else
1940-
static MagickBooleanType ValidateXMPProfile(Image *image,
1941-
const StringInfo *magick_unused(profile),ExceptionInfo *exception)
1942-
{
1943-
magick_unreferenced(profile);
1944-
(void) ThrowMagickException(exception,GetMagickModule(),
1945-
MissingDelegateWarning,"DelegateLibrarySupportNotBuiltIn","'%s' (XML)",
1946-
image->filename);
1947-
return(MagickFalse);
1948-
}
1938+
(void) image;
1939+
(void) profile;
1940+
(void) exception;
19491941
#endif
1942+
return(MagickTrue);
1943+
}
19501944

19511945
static MagickBooleanType SetImageProfileInternal(Image *image,const char *name,
19521946
const StringInfo *profile,const MagickBooleanType recursive,

ImageMagick-7.1.1-16/MagickCore/resource-private.h ImageMagick-7.1.1-17/MagickCore/resource-private.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright @ 2002 ImageMagick Studio LLC, a non-profit organization
2+
Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization
33
dedicated to making software imaging solutions freely available.
44
55
You may not use this file except in compliance with the License. You may

ImageMagick-7.1.1-16/MagickCore/resource_.h ImageMagick-7.1.1-17/MagickCore/resource_.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright @ 2002 ImageMagick Studio LLC, a non-profit organization
2+
Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization
33
dedicated to making software imaging solutions freely available.
44
55
You may not use this file except in compliance with the License. You may
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

ImageMagick-7.1.1-16/MagickCore/xml-tree-private.h ImageMagick-7.1.1-17/MagickCore/xml-tree-private.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright @ 2004 ImageMagick Studio LLC, a non-profit organization
2+
Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization
33
dedicated to making software imaging solutions freely available.
44
55
You may not use this file except in compliance with the License. You may

0 commit comments

Comments
 (0)