mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-06 04:33:49 +01:00
VK: Add extra safety checks around font texture creation. Motivated by some Play crashes.
This commit is contained in:
1 parent
c73b13781c
commit
7af93d08cf
4 files changed
+41
-18
No files matched your search
@@ -56,10 +56,15 @@ public class TextRenderer {
|
||||
total.y = (int) (p.descent() - p.ascent()) * lines.length + 2;
|
||||
// Returning a 0 size can create problems when the caller
|
||||
// uses the measurement to create a texture.
|
||||
// Also, clamp to a reasonable maximum size.
|
||||
if (total.x < 1)
|
||||
total.x = 1;
|
||||
if (total.y < 1)
|
||||
total.y = 1;
|
||||
if (total.x > 2048)
|
||||
total.x = 2048;
|
||||
if (total.y > 2048)
|
||||
total.y = 2048;
|
||||
return total;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user