mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
UWP: Add a missing bounds check from TextDrawerWin32::DrawStringBitmap
Fixes a crash on switching tabs
This commit is contained in:
parent
bb38cf842b
commit
c4572afdb1
1 changed files with 5 additions and 0 deletions
|
@ -359,6 +359,11 @@ void TextDrawerUWP::DrawStringBitmap(std::vector<uint8_t> &bitmapData, TextStrin
|
|||
size.cx = metrics.width + 1;
|
||||
size.cy = metrics.height + 1;
|
||||
|
||||
if (size.cx > MAX_TEXT_WIDTH)
|
||||
size.cx = MAX_TEXT_WIDTH;
|
||||
if (size.cy > MAX_TEXT_HEIGHT)
|
||||
size.cy = MAX_TEXT_HEIGHT;
|
||||
|
||||
// Prevent zero-sized textures, which can occur. Not worth to avoid
|
||||
// creating the texture altogether in this case. One example is a string
|
||||
// containing only '\r\n', see issue #10764.
|
||||
|
|
Loading…
Add table
Reference in a new issue