Changeset - r20527:f5972447e6ca
[Not reviewed]
master
0 1 0
frosch - 11 years ago 2013-07-01 19:53:05
frosch@openttd.org
(svn r25551) -Fix (r25465): Possible reading of uninitialised memory due to undefined execution order.
1 file changed with 4 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/gfx_layout.cpp
Show inline comments
 
@@ -319,7 +319,8 @@ ParagraphLayout::Line *ParagraphLayout::
 
		}
 

	
 
		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 @@ ParagraphLayout::Line *ParagraphLayout::
 
	}
 

	
 
	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;
 
}
0 comments (0 inline, 0 general)