]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/604
authorCristy <urban-warrior@imagemagick.org>
Sun, 23 Jul 2017 15:47:32 +0000 (11:47 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sun, 23 Jul 2017 18:21:55 +0000 (14:21 -0400)
coders/pdb.c

index 428f040d7dc664a048a24c231f0a08c8c6d55ee7..0412f3b1e33118a2cd15fa1d3a63122a2eacbde8 100644 (file)
@@ -571,7 +571,15 @@ static Image *ReadPDBImage(const ImageInfo *image_info,ExceptionInfo *exception)
         length;
 
       num_pad_bytes = (size_t) (comment_offset - TellBlob( image ));
-      while (num_pad_bytes--) ReadBlobByte( image );
+      while (num_pad_bytes-- != 0)
+      {
+        int
+          c;
+
+        c=ReadBlobByte(image);
+        if (c == EOF)
+          break;
+      }
 
       /*
         Read comment.