sizeof(*comment));
if (comment == (char *) NULL)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
- count=ReadBlob(image,tga_info.id_length,(unsigned char *) comment);
- comment[tga_info.id_length]='\0';
- (void) SetImageProperty(image,"comment",comment,exception);
- comment=DestroyString(comment);
+ count=ReadBlob(image,length,(unsigned char *) comment);
+ if (count == length)
+ {
+ comment[length]='\0';
+ (void) SetImageProperty(image,"comment",comment,exception);
+ comment=DestroyString(comment);
+ }
}
if (tga_info.attributes & (1UL << 4))
{