Skip to content

Commit 65f75a3

Browse files
author
Cristy
committed
https://github.com/ImageMagick/ImageMagick/pull/359
1 parent 2b72652 commit 65f75a3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Diff for: coders/tga.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,7 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image)
710710
compression;
711711

712712
const char
713+
*comment,
713714
*value;
714715

715716
const double
@@ -766,9 +767,9 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image)
766767
compression=image_info->compression;
767768
range=GetQuantumRange(5UL);
768769
tga_info.id_length=0;
769-
value=GetImageProperty(image,"comment");
770-
if (value != (const char *) NULL)
771-
tga_info.id_length=(unsigned char) MagickMin(strlen(value),255);
770+
comment=GetImageProperty(image,"comment");
771+
if (comment != (const char *) NULL)
772+
tga_info.id_length=(unsigned char) MagickMin(strlen(comment),255);
772773
tga_info.colormap_type=0;
773774
tga_info.colormap_index=0;
774775
tga_info.colormap_length=0;
@@ -852,7 +853,7 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image)
852853
(void) WriteBlobByte(image,tga_info.bits_per_pixel);
853854
(void) WriteBlobByte(image,tga_info.attributes);
854855
if (tga_info.id_length != 0)
855-
(void) WriteBlob(image,tga_info.id_length,(unsigned char *) value);
856+
(void) WriteBlob(image,tga_info.id_length,(unsigned char *) comment);
856857
if (tga_info.colormap_type != 0)
857858
{
858859
unsigned char

0 commit comments

Comments
 (0)