]> granicus.if.org Git - imagemagick/commitdiff
Fixed overflow.
authordirk <dirk@git.imagemagick.org>
Fri, 15 Jan 2016 00:13:19 +0000 (01:13 +0100)
committerdirk <dirk@git.imagemagick.org>
Fri, 15 Jan 2016 00:13:19 +0000 (01:13 +0100)
coders/psd.c

index 907e45dd5cbeea7a844d32609bd4c52c92ae527e..5f5fba6c62d0bd54f960c6f09f73f37318f84e51 100644 (file)
@@ -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");
     }