mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 08:00:58 +00:00
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:
parent
526d2236d9
commit
87d19de51f
1 changed files with 10 additions and 3 deletions
|
@ -61,10 +61,17 @@
|
||||||
+ (BOOL) canInitWithData: (NSData *)data
|
+ (BOOL) canInitWithData: (NSData *)data
|
||||||
{
|
{
|
||||||
TIFF *image = NULL;
|
TIFF *image = NULL;
|
||||||
image = NSTiffOpenDataRead((char *)[data bytes], [data length]);
|
image = NSTiffOpenDataRead ((char *)[data bytes], [data length]);
|
||||||
NSTiffClose(image);
|
|
||||||
|
|
||||||
return (image) ? YES : NO;
|
if (image != NULL)
|
||||||
|
{
|
||||||
|
NSTiffClose (image);
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSArray *) imageUnfilteredFileTypes
|
+ (NSArray *) imageUnfilteredFileTypes
|
||||||
|
|
Loading…
Reference in a new issue