From a104e317ce2bb5ef03b2dc81d753ad946408db53 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Wed, 3 Dec 2014 20:14:08 +0100 Subject: [PATCH] __imlib_LoadImage(): Additionally check loader_ret to detect loader failures Fixes: ==14822== Conditional jump or move depends on uninitialised value(s) ==14822== at 0x4E08376: load (loader_tiff.c:285) ==14822== by 0x1F7D70F: __imlib_LoadImage (image.c:1041) ==14822== by 0x1F090E4: imlib_load_image_with_error_return (api.c:1299) ==14822== by 0x40F47B: feh_load_image (imlib.c:252) ==14822== by 0x42CA0E: winwidget_loadimage (winwidget.c:753) ==14822== by 0x42C918: winwidget_create_from_file (winwidget.c:126) ==14822== by 0x421869: init_slideshow_mode (slideshow.c:62) ==14822== by 0x418F13: main (main.c:78) ==14822== ==14822== Conditional jump or move depends on uninitialised value(s) ==14822== at 0x4E083BC: load (loader_tiff.c:285) ==14822== by 0x1F7D70F: __imlib_LoadImage (image.c:1041) ==14822== by 0x1F090E4: imlib_load_image_with_error_return (api.c:1299) ==14822== by 0x40F47B: feh_load_image (imlib.c:252) ==14822== by 0x42CA0E: winwidget_loadimage (winwidget.c:753) ==14822== by 0x42C918: winwidget_create_from_file (winwidget.c:126) ==14822== by 0x421869: init_slideshow_mode (slideshow.c:62) ==14822== by 0x418F13: main (main.c:78) ==14822== when scaling id:000407,src:000226,op:havoc,rep:32 in feh. --- 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 ef7c33b..be35d34 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 (im->w == 0) + if ((loader_ret == 0) || (im->w == 0)) { /* if the caller wants an error return */ if (er)