File ImageMagick-CVE-2019-11007.patch of Package ImageMagick.29977
Index: ImageMagick-6.8.8-1/coders/png.c
===================================================================
--- ImageMagick-6.8.8-1.orig/coders/png.c 2019-04-15 16:13:13.392015129 +0200
+++ ImageMagick-6.8.8-1/coders/png.c 2019-04-15 16:13:43.572171305 +0200
@@ -3564,7 +3564,8 @@ static Image *ReadOnePNGImage(MngInfo *m
{
png_destroy_read_struct(&ping,&ping_info,&end_info);
pixel_info=RelinquishVirtualMemory(pixel_info);
- image->colors=2;
+ if (AcquireImageColormap(image,2) == MagickFalse)
+ ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
(void) SetImageBackgroundColor(image);
#ifdef PNG_SETJMP_NOT_THREAD_SAFE
UnlockSemaphoreInfo(ping_semaphore);