based on the fact that the crash never seemed to have happened with default screen resolutions and also inspired by the only other getmem usage in the code I came up with this simple solution which seems to work just fine.
I do not understand why getmem seems to need this, but well - feel free to explain.
--- a/hedgewars/uMisc.pas Thu Sep 15 03:17:23 2011 +0200
+++ b/hedgewars/uMisc.pas Thu Sep 15 09:19:56 2011 +0200
@@ -32,7 +32,7 @@
procedure freeModule;
implementation
-uses typinfo, sysutils, uVariables;
+uses typinfo, sysutils, uVariables, uUtils;
procedure movecursor(dx, dy: LongInt);
var x, y: LongInt;
@@ -74,7 +74,7 @@
ScreenFadeValue:= sfMax;
ScreenFadeSpeed:= 5;
-size:= cScreenWidth * cScreenHeight * 3;
+size:= toPowerOf2(cScreenWidth) * toPowerOf2(cScreenHeight) * 3;
p:= GetMem(size);
// memory could not be allocated