From cb8e611e3373d8a87c931855916cf079eaad55dc Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 14 Dec 2015 04:35:50 +0100 Subject: [PATCH] SWORD25: Fix uninitialized variable usage. When using the constructor of Panel which directly calls unpersist _color was uninitialized. However, unpersit uses setColor which assumes _color is initialized properly. Caused valgrind warnings when loading. --- engines/sword25/gfx/panel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/sword25/gfx/panel.cpp b/engines/sword25/gfx/panel.cpp index 9699db7f6a4..2b718540600 100644 --- a/engines/sword25/gfx/panel.cpp +++ b/engines/sword25/gfx/panel.cpp @@ -62,7 +62,7 @@ Panel::Panel(RenderObjectPtr parentPtr, int width, int height, uin } Panel::Panel(InputPersistenceBlock &reader, RenderObjectPtr parentPtr, uint handle) : - RenderObject(parentPtr, RenderObject::TYPE_PANEL, handle) { + RenderObject(parentPtr, RenderObject::TYPE_PANEL, handle), _color(0) { _initSuccess = unpersist(reader); }