File ImageMagick-CVE-2015-8902.patch of Package ImageMagick.8212

From 89f839d02a8f261c94f7f7075c3cf90724802958 Mon Sep 17 00:00:00 2001
From: cristy <urban-warrior@git.imagemagick.org>
Date: Sun, 25 Jan 2015 17:32:32 +0000
Subject: [PATCH]

---
 coders/miff.c  | 22 ++++++++++++++++++++--
 coders/pdb.c   | 10 +++++++++-
 coders/vicar.c |  2 ++
 3 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/coders/pdb.c b/coders/pdb.c
index 2a63a0a..f482c77 100644
--- a/coders/pdb.c
+++ b/coders/pdb.c
@@ -369,7 +369,15 @@ static Image *ReadPDBImage(const ImageInfo *image_info,ExceptionInfo *exception)
         ThrowReaderException(CorruptImageError,"CorruptImage");
     }
   num_pad_bytes = (size_t) (img_offset - TellBlob( image ));
-  while (num_pad_bytes--) ReadBlobByte( image );
+  while (num_pad_bytes-- != 0)
+  {
+    int
+      c;
+
+    c=ReadBlobByte(image);
+    if (c == EOF)
+      break;
+  }
   /*
     Read image header.
   */