From 55ddd412c33d65a5dad83efddea5fbe06259d620 Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Sun, 14 Dec 2014 16:38:48 +0100 Subject: [PATCH] Revert "__imlib_LoadImage(): Additionally check loader_ret to detect loader failures" This reverts commit a104e317ce2bb5ef03b2dc81d753ad946408db53. Breaks image loading in certain situations. It seems that some loaders may return 0 even when load() "succeeds". This appears to happen with the jpeg loader when not loading data immediately (but only reading the header). In this case jpeg_finish_decompress() exits via _JPEGFatalErrorHandler() -> longjmp() causing the return code to be 0. The fix reverted here is probably basically correct, but it will have to wait until the loaders are fixed to behave properly. --- src/lib/image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/image.c b/src/lib/image.c index be35d34..ef7c33b 100644 --- a/src/lib/image.c +++ b/src/lib/image.c @@ -1048,7 +1048,7 @@ __imlib_LoadImage(const char *file, ImlibProgressFunction progress, im->loader = best_loader; /* all loaders have been tried and they all failed. free the skeleton */ /* image struct we had and return NULL */ - if ((loader_ret == 0) || (im->w == 0)) + if (im->w == 0) { /* if the caller wants an error return */ if (er)