Free up memory after a ICC profile is removed.

This commit is contained in:
Cristy
2020-06-03 14:45:16 -04:00
parent 014e491539
commit eda082ee97
5 changed files with 16 additions and 2 deletions
+6
View File
@@ -1,3 +1,9 @@
2020-06-03 7.0.10-17 Cristy <quetzlzacatenango@image...>
* Release ImageMagick version 7.0.10-17, GIT revision 17...
2020-06-03 7.0.10-17 Cristy <quetzlzacatenango@image...>
* Free up memory after a ICC profile is removed.
2020-05-31 7.0.10-16 Cristy <quetzlzacatenango@image...>
* Release ImageMagick version 7.0.10-16, GIT revision 17294:5be1abe:20200531
+2
View File
@@ -923,6 +923,8 @@ MagickExport MagickBooleanType ProfileImage(Image *image,const char *name,
#endif
#define ThrowProfileException(severity,tag,context) \
{ \
if (profile != (StringInfo *) NULL) \
profile=DestroyStringInfo(profile); \
if (cms_context != (cmsContext) NULL) \
cmsDeleteContext(cms_context); \
if (source_info.profile != (cmsHPROFILE) NULL) \
+5 -1
View File
@@ -4566,7 +4566,11 @@ MagickExport MagickBooleanType SetImageProperty(Image *image,
(void) SetImageInfo(image_info,1,exception);
profile=FileToStringInfo(image_info->filename,~0UL,exception);
if (profile != (StringInfo *) NULL)
status=SetImageProfile(image,image_info->magick,profile,exception);
{
status=SetImageProfile(image,image_info->magick,profile,
exception);
profile=DestroyStringInfo(profile);
}
image_info=DestroyImageInfo(image_info);
return(MagickTrue);
}
+2
View File
@@ -343,6 +343,8 @@ MagickExport StringInfo *CloneStringInfo(const StringInfo *string_info)
assert(string_info != (StringInfo *) NULL);
assert(string_info->signature == MagickCoreSignature);
clone_info=AcquireStringInfo(string_info->length);
(void) CloneString(&clone_info->path,string_info->path);
(void) CloneString(&clone_info->name,string_info->name);
if (string_info->length != 0)
(void) memcpy(clone_info->datum,string_info->datum,string_info->length+1);
return(clone_info);
+1 -1
View File
@@ -278,7 +278,7 @@ static int GetCharacter(j_decompress_ptr jpeg_info)
{
(void) (*jpeg_info->src->fill_input_buffer)(jpeg_info);
if (jpeg_info->err->msg_code == JWRN_JPEG_EOF)
return EOF;
return(EOF);
}
jpeg_info->src->bytes_in_buffer--;
return((int) GETJOCTET(*jpeg_info->src->next_input_byte++));