Skip to content

Commit

Permalink
cosmetic
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Oct 22, 2022
1 parent 41d847b commit 4d002f8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions coders/tga.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ static Image *ReadTGAImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (EOFBlob(image) != MagickFalse)
ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
image->filename);
if (SeekBlob(image,-26,SEEK_END) > 0)
if (SeekBlob(image,-26,SEEK_END) >= 18)
{
/*
Optional header.
Expand All @@ -617,14 +617,15 @@ static Image *ReadTGAImage(const ImageInfo *image_info,ExceptionInfo *exception)
(void) SetImageProperty(image,"tga:author",tga_info.author);
count=ReadBlob(image,324,(unsigned char *) &tga_info.comment);
tga_info.comment[324]='\0';
(void) SetImageProperty(image,"comment",tga_info.comment);
(void) SetImageProperty(image,"tga:comment",tga_info.comment);
(void) DiscardBlobBytes(image,59);
count=ReadBlob(image,41,(unsigned char *) &tga_info.software);
tga_info.comment[41]='\0';
(void) SetImageProperty(image,"tga:software",tga_info.software);
(void) DiscardBlobBytes(image,27);
tga_info.attributes_type=(unsigned char) ReadBlobByte(image);
if ((image->matte != MagickFalse) && (tga_info.attributes_type != 3))
if ((image->matte != MagickFalse) &&
(tga_info.attributes_type != 3))
image->matte=MagickFalse;
}
}
Expand Down

0 comments on commit 4d002f8

Please sign in to comment.