From: Mikko Rasa Date: Thu, 10 Oct 2013 17:58:05 +0000 (+0300) Subject: Tweak QuartzLoader a bit X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=06bc1c43ef26b3256dd92a20dbdf7ed9e08bab04;p=libs%2Fgui.git Tweak QuartzLoader a bit Apparently OS X 10.5 uses kCGImageStatusReadingHeader, while 10.8 uses kCGImageStatusIncomplete. Also check that we actually got an image when trying to load. --- diff --git a/source/graphics/quartz/quartzloader.cpp b/source/graphics/quartz/quartzloader.cpp index aa11daa..3447f5f 100644 --- a/source/graphics/quartz/quartzloader.cpp +++ b/source/graphics/quartz/quartzloader.cpp @@ -82,12 +82,14 @@ bool QuartzLoader::detect(const string &sig) CFRelease(data); CFRelease(source); - return status==kCGImageStatusIncomplete; + return status==kCGImageStatusIncomplete || status==kCGImageStatusReadingHeader; } void QuartzLoader::load(Image::Data &data) { CGImageRef image = CGImageSourceCreateImageAtIndex(priv->source, 0, 0); + if(!image) + throw bad_image_data("null image"); try {