]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 16 Dec 2014 19:43:32 +0000 (19:43 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 16 Dec 2014 19:43:32 +0000 (19:43 +0000)
coders/pnm.c
coders/xpm.c

index 7b501fd4555e9c23289c4d06023ed553c12a782e..67325a2a11d3f206e55dbf51a45be2de74441e05 100644 (file)
@@ -153,8 +153,8 @@ static void PNMComment(Image *image,ExceptionInfo *exception)
     Read comment.
   */
   comment=AcquireString(GetImageProperty(image,"comment",exception));
-  extent=MaxTextExtent;
   p=comment+strlen(comment);
+  extent=strlen(comment)+MaxTextExtent;
   for (c='#'; (c != EOF) && (c != (int) '\n'); p++)
   {
     if ((size_t) (p-comment+1) >= extent)
index 72cd64778dd600739351803c7d261eb3088325a0..bdbb514d799bbcedc60c13a5173dc00b486b791e 100644 (file)
@@ -157,7 +157,7 @@ static size_t CopyXPMColor(char *destination,const char *source,size_t length)
     *p;
 
   p=source;
-  while (length-- && (*p != '\0'))
+  while (--length && (*p != '\0'))
     *destination++=(*p++);
   *destination='\0';
   return((size_t) (p-source));