From ae2637e36e7e09f9b3061d5b70f5a9f8fe5858c3 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 21 May 2018 22:31:56 +0200 Subject: FULLPIPE: Properly reserve arrays when deserializing. Pointed by whiterandrek --- engines/fullpipe/utils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/fullpipe') diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp index c1cf912de6..3b60e962c6 100644 --- a/engines/fullpipe/utils.cpp +++ b/engines/fullpipe/utils.cpp @@ -49,7 +49,7 @@ bool ObArray::load(MfcArchive &file) { debugC(5, kDebugLoading, "ObArray::load()"); int count = file.readCount(); - resize(count); + reserve(count); for (int i = 0; i < count; i++) { CObject *t = file.readClass(); @@ -66,7 +66,7 @@ bool DWordArray::load(MfcArchive &file) { debugC(9, kDebugLoading, "DWordArray::count: %d", count); - resize(count); + reserve(count); for (int i = 0; i < count; i++) { int32 t = file.readSint32LE(); -- cgit v1.2.3