From b13cfcdd862ad426857b9e5825f6c73576d0358c Mon Sep 17 00:00:00 2001 From: cloudwalk Date: Fri, 24 Jul 2020 16:00:52 +0000 Subject: [PATCH] image_png: Fix library load order. Fixes broken external textures in some games git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12870 d7cf8633-e32d-0410-b094-e92efae38249 --- image_png.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/image_png.c b/image_png.c index 9c712d15..7ef74f9a 100644 --- a/image_png.c +++ b/image_png.c @@ -172,16 +172,14 @@ qboolean PNG_OpenLibrary (void) return true; // Load the DLL - if(!Sys_LoadLibrary (dllnames, &png14_dll, pngfuncs)) - { - if(qpng_access_version_number() / 100 >= 104) - return false; - if(!Sys_LoadLibrary (dllnames, &png_dll, png14funcs)) + if(!Sys_LoadLibrary (dllnames, &png_dll, pngfuncs)) + return false; + if(qpng_access_version_number() / 100 >= 104) + if(!Sys_LoadLibrary (dllnames, &png14_dll, png14funcs)) { - Sys_UnloadLibrary (&png14_dll); + Sys_UnloadLibrary (&png_dll); return false; } - } return true; } -- 2.39.2