diff options
Diffstat (limited to 'source/blender/quicktime/apple/qtkit_import.m')
-rw-r--r-- | source/blender/quicktime/apple/qtkit_import.m | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/quicktime/apple/qtkit_import.m b/source/blender/quicktime/apple/qtkit_import.m index 43c17644681..80b97066b61 100644 --- a/source/blender/quicktime/apple/qtkit_import.m +++ b/source/blender/quicktime/apple/qtkit_import.m @@ -198,7 +198,6 @@ static ImBuf * nsImageToiBuf(NSImage *sourceImage, int width, int height) rasterRGB = (uchar*)[blBitmapFormatImageRGB bitmapData]; if (rasterRGB == NULL) { - [bitmapImage release]; [blBitmapFormatImageRGB release]; return NULL; } @@ -220,7 +219,6 @@ static ImBuf * nsImageToiBuf(NSImage *sourceImage, int width, int height) rasterRGBA = (uchar*)[blBitmapFormatImageRGBA bitmapData]; if (rasterRGBA == NULL) { - [bitmapImage release]; [blBitmapFormatImageRGB release]; [blBitmapFormatImageRGBA release]; return NULL; @@ -378,7 +376,11 @@ int imb_is_a_quicktime (char *name) { NSImage *image; int result; - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + NSAutoreleasePool *pool; + + if(!G.have_quicktime) return 0; + + pool = [[NSAutoreleasePool alloc] init]; // dont let quicktime image import handle these if( BLI_testextensie(name, ".swf") || @@ -390,13 +392,14 @@ int imb_is_a_quicktime (char *name) BLI_testextensie(name, ".mp3")) return 0; - image = [NSImage alloc]; - if ([image initWithContentsOfFile:[NSString stringWithUTF8String:name]]) + image = [[NSImage alloc] initWithContentsOfFile:[NSString stringWithUTF8String:name]]; + if (image) { + [image release]; result = true; + } else result = false; - [image release]; [pool drain]; return result; } @@ -413,6 +416,9 @@ ImBuf *imb_quicktime_decode(unsigned char *mem, int size, int flags) NSBitmapImageRep *bitmapImage; NSBitmapImageRep *blBitmapFormatImageRGB,*blBitmapFormatImageRGBA; NSAutoreleasePool *pool; + + if(!G.have_quicktime) + return NULL; pool = [[NSAutoreleasePool alloc] init]; |