]> granicus.if.org Git - imagemagick/commitdiff
Fix improper cast that could cause an overflow as demonstrated in #347.
authorDirk Lemstra <dirk@git.imagemagick.org>
Sat, 7 Jan 2017 15:56:49 +0000 (16:56 +0100)
committerDirk Lemstra <dirk@git.imagemagick.org>
Sat, 7 Jan 2017 15:56:49 +0000 (16:56 +0100)
coders/psd.c

index 9249e2e96581a4e21ee21c0f6aac217134f72102..75ebd1d4835083698fc4c973ce0a63a22452e6f1 100644 (file)
@@ -1691,7 +1691,7 @@ ModuleExport MagickBooleanType ReadPSDLayers(Image *image,
             /*
               Layer name.
             */
-            length=(MagickSizeType) ReadBlobByte(image);
+            length=(MagickSizeType) (unsigned char) ReadBlobByte(image);
             combined_length+=length+1;
             if (length > 0)
               (void) ReadBlob(image,(size_t) length++,layer_info[i].name);