From f8766ec663b1faeda81c0c3a8e855f6502276fa9 Mon Sep 17 00:00:00 2001 From: Cristy Date: Fri, 11 May 2018 20:56:37 -0400 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8234 --- MagickCore/property.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/MagickCore/property.c b/MagickCore/property.c index 419600dab..09b532bec 100644 --- a/MagickCore/property.c +++ b/MagickCore/property.c @@ -1677,19 +1677,27 @@ static MagickBooleanType GetICCProperty(const Image *image,const char *property, char info[MagickPathExtent]; - if (cmsGetProfileInfoASCII(icc_profile,cmsInfoDescription,"en","US", - info,MagickPathExtent) != 0) + int + status; + + (void) memset(info,0,sizeof(info)); + status=cmsGetProfileInfoASCII(icc_profile,cmsInfoDescription,"en","US", + info,MagickPathExtent); + if (status != 0) (void) SetImageProperty((Image *) image,"icc:description",info, exception); - if (cmsGetProfileInfoASCII(icc_profile,cmsInfoManufacturer,"en","US", - info,MagickPathExtent) != 0) + status=cmsGetProfileInfoASCII(icc_profile,cmsInfoManufacturer,"en","US", + info,MagickPathExtent); + if (status != 0) (void) SetImageProperty((Image *) image,"icc:manufacturer",info, exception); - if (cmsGetProfileInfoASCII(icc_profile,cmsInfoModel,"en","US",info, - MagickPathExtent) != 0) + status=cmsGetProfileInfoASCII(icc_profile,cmsInfoModel,"en","US", + info,MagickPathExtent); + if (status != 0) (void) SetImageProperty((Image *) image,"icc:model",info,exception); - if (cmsGetProfileInfoASCII(icc_profile,cmsInfoCopyright,"en","US", - info,MagickPathExtent) != 0) + status=cmsGetProfileInfoASCII(icc_profile,cmsInfoCopyright,"en","US", + info,MagickPathExtent); + if (status != 0) (void) SetImageProperty((Image *) image,"icc:copyright",info, exception); #endif -- 2.40.0