aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2006-01-28 23:11:52 +0000
committerJohannes Schickel2006-01-28 23:11:52 +0000
commit8776ea6d189d13552f356e440db4e6402d630df4 (patch)
tree7698afb08096012f92d74132874292aab0cab070
parent5fda0cc6f1addedb4e3c671a9f124e6c5b253323 (diff)
downloadscummvm-rg350-8776ea6d189d13552f356e440db4e6402d630df4.tar.gz
scummvm-rg350-8776ea6d189d13552f356e440db4e6402d630df4.tar.bz2
scummvm-rg350-8776ea6d189d13552f356e440db4e6402d630df4.zip
Fixes a bug while loading the theme config from the zip file (now the caret should be black).
svn-id: r20277
-rw-r--r--gui/ThemeNew.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/gui/ThemeNew.cpp b/gui/ThemeNew.cpp
index a196487101..d32a772edc 100644
--- a/gui/ThemeNew.cpp
+++ b/gui/ThemeNew.cpp
@@ -77,11 +77,12 @@ _forceRedraw(false), _font(0), _imageHandles(0), _images(0), _colors() {
unz_file_info fileInfo;
unzOpenCurrentFile(zipFile);
unzGetCurrentFileInfo(zipFile, &fileInfo, NULL, 0, NULL, 0, NULL, 0);
- uint8 *buffer = new uint8[fileInfo.uncompressed_size];
+ uint8 *buffer = new uint8[fileInfo.uncompressed_size+1];
assert(buffer);
+ memset(buffer, 0, (fileInfo.uncompressed_size+1)*sizeof(uint8));
unzReadCurrentFile(zipFile, buffer, fileInfo.uncompressed_size);
unzCloseCurrentFile(zipFile);
- Common::MemoryReadStream stream(buffer, fileInfo.uncompressed_size);
+ Common::MemoryReadStream stream(buffer, fileInfo.uncompressed_size+1);
if (!_configFile.loadFromStream(stream)) {
warning("Can not find theme config file '%s'", (stylefile + ".ini").c_str());
unzClose(zipFile);