From e92040ea6ee2a844ebfd2344174076795a4787bd Mon Sep 17 00:00:00 2001 From: Cristy Date: Fri, 21 Jun 2019 20:17:04 -0400 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/1612 --- coders/pnm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coders/pnm.c b/coders/pnm.c index f6f69bf83..a54bc60c3 100644 --- a/coders/pnm.c +++ b/coders/pnm.c @@ -1826,7 +1826,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image, extent=(size_t) count; (void) strncpy((char *) q,buffer,extent); q+=extent; - if ((q-pixels+extent+1) >= sizeof(pixels)) + if ((q-pixels+extent+2) >= sizeof(pixels)) { *q++='\n'; (void) WriteBlob(image,q-pixels,pixels); @@ -1901,7 +1901,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image, extent=(size_t) count; (void) strncpy((char *) q,buffer,extent); q+=extent; - if ((q-pixels+extent+1) >= sizeof(pixels)) + if ((q-pixels+extent+2) >= sizeof(pixels)) { *q++='\n'; (void) WriteBlob(image,q-pixels,pixels); -- 2.40.0