evas: check the availability of the generic loader before execing it.
authorCedric BAIL <cedric.bail@free.fr>
Mon, 26 Dec 2011 15:23:30 +0000 (15:23 +0000)
committerCedric BAIL <cedric.bail@free.fr>
Mon, 26 Dec 2011 15:23:30 +0000 (15:23 +0000)
Patch requested by Guillaume Friloux.

SVN revision: 66532

legacy/evas/src/modules/loaders/generic/evas_image_load_generic.c

index 6e07fd8..4025367 100644 (file)
@@ -126,6 +126,7 @@ _load(Image_Entry *ie, const char *file, const char *key, int *error, Eina_Bool
    img_loader = alloca(cmd_len + 1);
    strcpy(img_loader, libdir);
    strcat(img_loader, loader);
+
    // params excluding file, key and loadopts
    cmd_len += 1024;
    cmd_len += strlen(file) * 2;
@@ -189,6 +190,8 @@ _load(Image_Entry *ie, const char *file, const char *key, int *error, Eina_Bool
         // will interpret shell stuff and path hunt that will then exec the
         // program itself that will dynamically link that will again
         // parse the arguments and finally do something...
+        if (access(decoders[try_count], X_OK)) continue;
+
         strcpy(cmd, decoders[try_count]);
         strcat(cmd, " ");
         // filename first arg