From d523bd4b1e85ea2a58902efec3eb63e947598d7a Mon Sep 17 00:00:00 2001 From: Cristy Date: Sat, 10 Aug 2019 07:26:04 -0400 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/1614 --- coders/pnm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.40.0