]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/pull/359
authorCristy <urban-warrior@imagemagick.org>
Fri, 20 Jan 2017 00:32:04 +0000 (19:32 -0500)
committerCristy <urban-warrior@imagemagick.org>
Fri, 20 Jan 2017 00:32:04 +0000 (19:32 -0500)
coders/tga.c

index 71e43858b453b5ffb9fb4c0a6b814676f716611f..42a7677655f9f1a7756c9655823da304f5b6bc13 100644 (file)
@@ -713,6 +713,7 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image,
     compression;
 
   const char
+    *comment,
     *value;
 
   const double
@@ -771,9 +772,9 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image,
     compression=image_info->compression;
   range=GetQuantumRange(5UL);
   tga_info.id_length=0;
-  value=GetImageProperty(image,"comment",exception);
-  if (value != (const char *) NULL)
-    tga_info.id_length=(unsigned char) MagickMin(strlen(value),255);
+  comment=GetImageProperty(image,"comment",exception);
+  if (comment != (const char *) NULL)
+    tga_info.id_length=(unsigned char) MagickMin(strlen(comment),255);
   tga_info.colormap_type=0;
   tga_info.colormap_index=0;
   tga_info.colormap_length=0;
@@ -857,7 +858,7 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image,
   (void) WriteBlobByte(image,tga_info.bits_per_pixel);
   (void) WriteBlobByte(image,tga_info.attributes);
   if (tga_info.id_length != 0)
-    (void) WriteBlob(image,tga_info.id_length,(unsigned char *) value);
+    (void) WriteBlob(image,tga_info.id_length,(unsigned char *) comment);
   if (tga_info.colormap_type != 0)
     {
       unsigned char