2260: Fix out of bounds read r=def- a=Learath2

@Jupeyy I'm not completely familiar with the text rendering code but I think it needs a large rework. The code isn't concise or easy to read, the interface is horrendous.

e.g. That `MaxWidth` parameter on `DoLabel` is an integer and it's used completely wrongly leading to a out of bounds read.

Co-authored-by: Learath <learath2@gmail.com>
This commit is contained in:
bors[bot] 2020-06-14 09:43:24 +00:00 committed by GitHub
commit 18f5ae442a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -912,7 +912,7 @@ void CMenus::RenderNews(CUIRect MainView)
else
{
MainView.HSplitTop(20.0f, &Label, &MainView);
UI()->DoLabelScaled(&Label, aLine, 15.f, -1, MainView.w-30.0f);
UI()->DoLabelScaled(&Label, aLine, 15.f, -1, -1);
}
}
}