Fixed crash on checking whether it can init with data, if data is not

actually a tiff


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10811 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2001-08-30 17:26:47 +00:00
parent 526d2236d9
commit 87d19de51f

View file

@ -61,10 +61,17 @@
+ (BOOL) canInitWithData: (NSData *)data
{
TIFF *image = NULL;
image = NSTiffOpenDataRead((char *)[data bytes], [data length]);
NSTiffClose(image);
image = NSTiffOpenDataRead ((char *)[data bytes], [data length]);
return (image) ? YES : NO;
if (image != NULL)
{
NSTiffClose (image);
return YES;
}
else
{
return NO;
}
}
+ (NSArray *) imageUnfilteredFileTypes