From 73dd03cfb57f8f8c0a732fa062b9966ec7bf2f91 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Tue, 16 Jul 2019 21:31:03 +0200 Subject: [PATCH] Enlarge buffer to make it possible to read odd extent. --- coders/ps.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/coders/ps.c b/coders/ps.c index 9fc8b4afe..7b22a5146 100644 --- a/coders/ps.c +++ b/coders/ps.c @@ -415,9 +415,10 @@ static void ReadPSInfo(const ImageInfo *image_info,Image *image, continue; if ((MagickSizeType) extent > GetBlobSize(image)) continue; - ps_info->photoshop_profile=AcquireStringInfo((size_t) extent); + length=(size_t) extent; + ps_info->photoshop_profile=AcquireStringInfo(length+1U); q=GetStringInfoDatum(ps_info->photoshop_profile); - while (extent > 1) + while (extent > 0) { c=ProfileInteger(&buffer,hex_digits); if (c == EOF) @@ -425,6 +426,7 @@ static void ReadPSInfo(const ImageInfo *image_info,Image *image, *q++=(unsigned char) c; extent-=2; } + SetStringInfoLength(ps_info->icc_profile,length); continue; } if (image_info->page != (char *) NULL) -- 2.40.0