From cd25bd56238797a90fec5b79156be9aa36f43727 Mon Sep 17 00:00:00 2001 From: Lionel Ulmer Date: Sat, 26 Oct 2002 10:25:16 +0000 Subject: [PATCH] Fix another Valgrind warning during SMUSH playing. svn-id: r5317 --- scumm/smush/player.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scumm/smush/player.cpp b/scumm/smush/player.cpp index 1991b85c977..ffcd2dd438f 100644 --- a/scumm/smush/player.cpp +++ b/scumm/smush/player.cpp @@ -663,9 +663,10 @@ static StringResource * getStrings(const char * file, const char * directory, bo return getStrings(file, directory, false); } char * old = filebuffer; - filebuffer = new char[length - ETRS_HEADER_LENGTH]; + filebuffer = new char[length - ETRS_HEADER_LENGTH + 1]; for(int32 i = ETRS_HEADER_LENGTH; i < length; i++) filebuffer[i - ETRS_HEADER_LENGTH] = old[i] ^ 0xCC; + filebuffer[length - ETRS_HEADER_LENGTH] = '\0'; delete []old; length -= ETRS_HEADER_LENGTH; }