From b0697174bc27789ad6da3285ae5c3e8ef49f157f Mon Sep 17 00:00:00 2001 From: Wanne Date: Tue, 4 Oct 2011 16:51:35 +0000 Subject: [PATCH] - Improved the dirty bugfix "Out of memory bug", when loading a savegame with the wrong "data files" (original bugfix: revision: 4532) o The problem is the wrong (too height) number passed to the resize() method which leads to "out of memory exceptions" git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4683 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- SaveLoadGame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SaveLoadGame.cpp b/SaveLoadGame.cpp index 6e3dae9c..d45514a3 100644 --- a/SaveLoadGame.cpp +++ b/SaveLoadGame.cpp @@ -2404,7 +2404,7 @@ BOOLEAN OBJECTTYPE::Load( HWFILE hFile ) // The size can get any huge value, if we are using wrong items.xml on the savegame // In that case, the "objectStack.resize(size) consumes ALL the memory on the system and then the game crashes because of not enough free memory!!!! // When returning FALSE well tell there is something wrong and we can't load the savegame - if (size < 0 || size > 1000) + if (size < 0 || size >= 512) { return(FALSE); }