From: cristy Date: Mon, 15 Dec 2014 11:03:40 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~1642 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d178f436636e594e4e6ab009ba398b04de04557e;p=imagemagick --- diff --git a/coders/pnm.c b/coders/pnm.c index eb2837e2b..2df68020a 100644 --- a/coders/pnm.c +++ b/coders/pnm.c @@ -198,7 +198,7 @@ static unsigned int PNMInteger(Image *image,const unsigned int base, return(0); if (c == (int) '#') PNMComment(image,exception); - } while (isdigit(c) == MagickFalse); + } while ((c == ' ') || (c == '\t') || (c == '\n') || (c == '\r')); if (base == 2) return((unsigned int) (c-(int) '0')); /* @@ -214,6 +214,8 @@ static unsigned int PNMInteger(Image *image,const unsigned int base, break; value+=c-(int) '0'; c=ReadBlobByte(image); + if (c == EOF) + return(0); } while (isdigit(c) != 0); return(value); } diff --git a/coders/xbm.c b/coders/xbm.c index 9400ea759..e952bfb64 100644 --- a/coders/xbm.c +++ b/coders/xbm.c @@ -147,7 +147,7 @@ static unsigned int XBMInteger(Image *image,short int *hex_digits) c=ReadBlobByte(image); if (c == EOF) return(0); - } while (hex_digits[c] < 0); + } while ((c == ' ') || (c == '\t') || (c == '\n') || (c == '\r')); /* Evaluate number. */ @@ -162,6 +162,8 @@ static unsigned int XBMInteger(Image *image,short int *hex_digits) break; value+=hex_digits[c]; c=ReadBlobByte(image); + if (c == EOF) + return(0); } while (hex_digits[c] >= 0); return(value); }