Fix crash in case of critical image missing
authorunc0rr
Sat, 03 Jan 2015 00:29:34 +0300
changeset 10744 205cbe137461
parent 10742 34c1afbda24a
child 10746 c882355f7bc3
Fix crash in case of critical image missing
hedgewars/uStore.pas
--- a/hedgewars/uStore.pas	Fri Jan 02 23:54:11 2015 +0300
+++ b/hedgewars/uStore.pas	Sat Jan 03 00:29:34 2015 +0300
@@ -611,17 +611,17 @@
     // loading failed
     if tmpsurf = nil then
         begin
-
-        // anounce that loading failed
-        OutError(msgFailed, false);
-
         // output sdl error if loading failed when data source was available
         if rwops <> nil then
             begin
+            // anounce that loading failed
+            OutError(msgFailed, false);
+
             SDLTry(false, (imageFlags and ifCritical) <> 0);
             // rwops was already freed by IMG_Load_RW
             rwops:= nil;
-            end;
+            end else
+            OutError(msgFailed, (imageFlags and ifCritical) <> 0);
         exit;
         end;