Loader loading: Avoid access to uninitialized load() item

This commit is contained in:
Kim Woelders 2021-12-20 21:58:48 +01:00
parent f1bef7ae01
commit f9e0e92189
1 changed files with 2 additions and 1 deletions

View File

@ -125,6 +125,7 @@ __imlib_ProduceLoader(const char *file)
return NULL; return NULL;
} }
l->load2 = dlsym(l->handle, "load2"); l->load2 = dlsym(l->handle, "load2");
l->load = NULL;
if (!l->load2) if (!l->load2)
l->load = dlsym(l->handle, "load"); l->load = dlsym(l->handle, "load");
l->save = dlsym(l->handle, "save"); l->save = dlsym(l->handle, "save");
@ -281,7 +282,7 @@ __imlib_LookupLoadedLoader(const char *format, int for_save)
{ {
/* does it provide the function we need? */ /* does it provide the function we need? */
if ((for_save && l->save) || if ((for_save && l->save) ||
(!for_save && (l->load || l->load2))) (!for_save && (l->load2 || l->load)))
goto done; goto done;
} }
} }