Skip to content

Commit

Permalink
https://github.com/ImageMagick/ImageMagick/issues/1612
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Jun 22, 2019
1 parent 35c7032 commit cb5ec7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions coders/pnm.c
Expand Up @@ -1832,7 +1832,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);
Expand Down Expand Up @@ -1907,7 +1907,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);
Expand Down

0 comments on commit cb5ec7d

Please sign in to comment.