From: cristy Date: Sat, 10 Jan 2015 23:56:02 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~1460 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4693836b52ec11c0348f9687b8c1f92ce27f991f;p=imagemagick --- diff --git a/coders/wpg.c b/coders/wpg.c index cc292a30c..caec51537 100644 --- a/coders/wpg.c +++ b/coders/wpg.c @@ -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); }