changeset 20607:497874cbf20c draft

(svn r25551) -Fix (r25465): Possible reading of uninitialised memory due to undefined execution order.
author frosch <frosch@openttd.org>
date Mon, 01 Jul 2013 19:53:05 +0000
parents 517a1b2f0428
children 33186943b124
files src/gfx_layout.cpp
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/gfx_layout.cpp
+++ b/src/gfx_layout.cpp
@@ -319,7 +319,8 @@
 		}
 
 		if (this->buffer == next_run) {
-			*l->Append() = new VisualRun(iter->second, begin, this->buffer - begin, l->getWidth());
+			int w = l->getWidth();
+			*l->Append() = new VisualRun(iter->second, begin, this->buffer - begin, w);
 			iter++;
 			assert(iter != this->runs.End());
 
@@ -365,7 +366,8 @@
 	}
 
 	if (l->Length() == 0 || last_char - begin != 0) {
-		*l->Append() = new VisualRun(iter->second, begin, last_char - begin, l->getWidth());
+		int w = l->getWidth();
+		*l->Append() = new VisualRun(iter->second, begin, last_char - begin, w);
 	}
 	return l;
 }