You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1.1 KiB
31 lines
1.1 KiB
8 years ago
|
|
||
|
# HG changeset patch
|
||
|
# User Glenn Randers-Pehrson <glennrp+bmo@gmail.com>
|
||
|
# Date 1499262082 14400
|
||
|
# Node ID dea93a690fc125f70fb8688a0ff3035b96b0045e
|
||
|
# Parent a42ae8447fe7a457790bf699371a1a6f3c6d4e57
|
||
|
Stop crash due to zero-length color_image while reading a JNG
|
||
|
|
||
|
diff -r a42ae8447fe7 -r dea93a690fc1 coders/png.c
|
||
|
--- a/coders/png.c Tue Jul 04 16:33:37 2017 -0500
|
||
|
+++ b/coders/png.c Wed Jul 05 09:41:22 2017 -0400
|
||
|
@@ -3314,12 +3314,13 @@
|
||
|
|
||
|
if (logging)
|
||
|
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
|
||
|
- " Copying JDAT chunk data"
|
||
|
- " to color_blob.");
|
||
|
- if (color_image != (Image *)NULL)
|
||
|
+ " Copying %lu bytes of JDAT chunk data"
|
||
|
+ " to color_blob.",length);
|
||
|
+ if (length && color_image != (Image *)NULL)
|
||
|
+ {
|
||
|
(void) WriteBlob(color_image,length,(char *) chunk);
|
||
|
- if (length)
|
||
|
MagickFreeMemory(chunk);
|
||
|
+ }
|
||
|
continue;
|
||
|
}
|
||
|
|
||
|
|