From: cristy Date: Wed, 17 Aug 2011 01:23:06 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~7182 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=08f255a88c9f3c8271f0eeafb955b6a318fb4ef5;p=imagemagick --- diff --git a/coders/jpeg.c b/coders/jpeg.c index d6ad30ad7..f8782da7e 100644 --- a/coders/jpeg.c +++ b/coders/jpeg.c @@ -617,7 +617,7 @@ static boolean ReadProfile(j_decompress_ptr jpeg_info) ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename); p=GetStringInfoDatum(profile); - for (i=(ssize_t) GetStringInfoLength(profile)-1; i >= 0; i--) + for (i=0; i < (ssize_t) GetStringInfoLength(profile); i++) *p++=(unsigned char) GetCharacter(jpeg_info); if (marker == 1) { @@ -646,7 +646,15 @@ static boolean ReadProfile(j_decompress_ptr jpeg_info) } previous_profile=GetImageProfile(image,name); if (previous_profile != (const StringInfo *) NULL) - ConcatenateStringInfo(profile,previous_profile); + { + SetStringInfoLength(profile,GetStringInfoLength(profile)+ + GetStringInfoLength(previous_profile)); + (void) memcpy(GetStringInfoDatum(profile),GetStringInfoDatum(profile)+ + GetStringInfoLength(previous_profile),GetStringInfoLength(profile)); + (void) memcpy(GetStringInfoDatum(profile), + GetStringInfoDatum(previous_profile), + GetStringInfoLength(previous_profile)); + } status=SetImageProfile(image,name,profile); profile=DestroyStringInfo(profile); if (status == MagickFalse)