From 06bc1c43ef26b3256dd92a20dbdf7ed9e08bab04 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 10 Oct 2013 20:58:05 +0300 Subject: [PATCH] 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. --- source/graphics/quartz/quartzloader.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 { -- 2.45.2