Skip to content

Commit

Permalink
https://github.com/ImageMagick/ImageMagick/pull/359
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Jan 20, 2017
1 parent 699b444 commit 6e33867
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions coders/tga.c
Expand Up @@ -713,6 +713,7 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image,
compression;

const char
*comment,
*value;

const double
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6e33867

Please sign in to comment.