Commit 36b2e495b for imagemagick.org
commit 36b2e495b6557b56a772563bcfd50c3fade07eef
Author: haoxiang Yan <108142374+Yanhaoxi@users.noreply.github.com>
Date: Fri Sep 18 21:26:18 2026 +0800
Terminate the XMP profile collected by the Ghostscript reader (#8966)
diff --git a/coders/ghostscript-private.h b/coders/ghostscript-private.h
index ca569fa1a..01fb763d8 100644
--- a/coders/ghostscript-private.h
+++ b/coders/ghostscript-private.h
@@ -276,6 +276,8 @@ static inline void ReadGhostScriptXMPProfile(MagickByteBuffer *buffer,
}
}
SetStringInfoLength(*profile,(size_t) count);
+ /* ReadPDFImage() scans the profile as a C string. */
+ GetStringInfoDatum(*profile)[count]='\0';
}
static inline char *EscapeParenthesis(const char *source,