From 6f1879d498bcc5cce12fe0c5decb8dbc0f608e5d Mon Sep 17 00:00:00 2001 From: dirk Date: Fri, 15 Jan 2016 01:13:19 +0100 Subject: [PATCH] Fixed overflow. --- coders/psd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coders/psd.c b/coders/psd.c index 907e45dd5..5f5fba6c6 100644 --- a/coders/psd.c +++ b/coders/psd.c @@ -2363,8 +2363,8 @@ static MagickBooleanType WriteImageChannels(const PSDInfo *psd_info, compact_pixels=(unsigned char *) NULL; if (next_image->compression == RLECompression) { - compact_pixels=(unsigned char *) AcquireQuantumMemory(2*channels* - next_image->columns,packet_size*sizeof(*compact_pixels)); + compact_pixels=(unsigned char *) AcquireQuantumMemory((2*channels* + next_image->columns)+1,packet_size*sizeof(*compact_pixels)); if (compact_pixels == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); } -- 2.40.0