From 6eb41c04ff0708050d300c9aeced3adf36600c47 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 21 May 2012 23:11:41 +0000 Subject: [PATCH] win32: better error reporting in the GDI+ loader, based on a patch by ponce. --- src/image/codec/gdiplus-image.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/image/codec/gdiplus-image.cpp b/src/image/codec/gdiplus-image.cpp index 2f581d8f..6ccad07e 100644 --- a/src/image/codec/gdiplus-image.cpp +++ b/src/image/codec/gdiplus-image.cpp @@ -81,6 +81,16 @@ bool GdiPlusImageData::Open(char const *path) return false; } + if (bitmap->GetLastStatus() != Gdiplus::Ok) + { +#if !LOL_RELEASE + Log::Error("error %d loading %s\n", + (unsigned)bitmap->GetLastStatus(), path); +#endif + delete bitmap; + return false; + } + size = ivec2(bitmap->GetWidth(), bitmap->GetHeight()); format = Image::FORMAT_RGBA;