]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sat, 10 Jan 2015 23:56:02 +0000 (23:56 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sat, 10 Jan 2015 23:56:02 +0000 (23:56 +0000)
coders/wpg.c

index cc292a30cd79b788929a85c11787846c9d62bdeb..caec515378c9b41ac2494d329ea73ca5fe440219 100644 (file)
@@ -470,8 +470,13 @@ static int UnpackWPGRaster(Image *image,int bpp,ExceptionInfo *exception)
 
   while(y<(ssize_t) image->rows)
     {
-      bbuf=ReadBlobByte(image);
+      int
+        c;
 
+      c=ReadBlobByte(image);
+      if (c == EOF)
+        break;
+      bbuf=(unsigned char) c;
       RunCount=bbuf & 0x7F;
       if(bbuf & 0x80)
         {
@@ -517,7 +522,7 @@ static int UnpackWPGRaster(Image *image,int bpp,ExceptionInfo *exception)
       }
     }
   BImgBuff=(unsigned char *) RelinquishMagickMemory(BImgBuff);
-  return(0);
+  return(y <(ssize_t) image->rows ? -5 : 0);
 }