mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 06:15:04 +00:00
(svn r25551) -Fix (r25465): Possible reading of uninitialised memory due to undefined execution order.
This commit is contained in:
parent
d9065fbfbe
commit
e8b6d2b32d
@ -319,7 +319,8 @@ ParagraphLayout::Line *ParagraphLayout::nextLine(int max_width)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this->buffer == next_run) {
|
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++;
|
iter++;
|
||||||
assert(iter != this->runs.End());
|
assert(iter != this->runs.End());
|
||||||
|
|
||||||
@ -365,7 +366,8 @@ ParagraphLayout::Line *ParagraphLayout::nextLine(int max_width)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (l->Length() == 0 || last_char - begin != 0) {
|
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;
|
return l;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user