From: Cristy Date: Sat, 10 Aug 2019 11:26:04 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/1614 X-Git-Tag: 7.0.8-60~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d523bd4b1e85ea2a58902efec3eb63e947598d7a;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/1614 --- diff --git a/coders/pnm.c b/coders/pnm.c index 726740111..fd231ef31 100644 --- a/coders/pnm.c +++ b/coders/pnm.c @@ -1760,7 +1760,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image, { *q++=(unsigned char) (GetPixelLuma(image,p) >= (QuantumRange/2.0) ? '0' : '1'); - if ((q-pixels+1) >= (ssize_t) sizeof(pixels)) + if ((q-pixels+2) >= (ssize_t) sizeof(pixels)) { *q++='\n'; (void) WriteBlob(image,q-pixels,pixels);