--- a/hedgewars/uStore.pas Wed Oct 25 23:47:07 2017 +0200
+++ b/hedgewars/uStore.pas Wed Oct 25 19:44:42 2017 -0400
@@ -417,7 +417,10 @@
imflags := (imflags or ifCritical);
// load the image
- tmpsurf := LoadDataImageAltPath(Path, AltPath, FileName, imflags)
+ tmpsurf := LoadDataImageAltPath(Path, AltPath, FileName, imflags);
+ if (tmpsurf <> nil) and checkSum then
+ for y := 0 to tmpsurf^.h-1 do
+ syncedPixelDigest:= Adler32Update(syncedPixelDigest, @PByteArray(tmpsurf^.pixels)^[y*tmpsurf^.pitch], tmpsurf^.w*4)
end;
if tmpsurf <> nil then
@@ -471,10 +474,6 @@
{$IFDEF USE_CONTEXT_RESTORE}
Surface:= tmpsurf
{$ELSE}
- if checkSum then
- for y := 0 to tmpsurf^.h-1 do
- syncedPixelDigest:= Adler32Update(syncedPixelDigest, @PByteArray(tmpsurf^.pixels)^[y*tmpsurf^.pitch], tmpsurf^.w*4);
-
if saveSurf then
Surface:= tmpsurf
else