mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
GE Debugger: Fix crash stepping with large tex.
Some math was overflowing in allocations, and it would allocate zero bytes. Let's just refuse textures more actively.
This commit is contained in:
parent
a2ca85bc87
commit
18c9a4d9c9
1 changed files with 5 additions and 1 deletions
|
@ -1401,7 +1401,11 @@ bool GetCurrentTexture(GPUDebugBuffer &buffer, int level)
|
|||
int w = gstate.getTextureWidth(level);
|
||||
int h = gstate.getTextureHeight(level);
|
||||
|
||||
if (!texaddr || !Memory::IsValidRange(texaddr, (textureBitsPerPixel[texfmt] * texbufw * h) / 8))
|
||||
u32 sizeInBits = textureBitsPerPixel[texfmt] * (texbufw * (h - 1) + w);
|
||||
if (!texaddr || !Memory::IsValidRange(texaddr, sizeInBits / 8))
|
||||
return false;
|
||||
// We'll break trying to allocate this much.
|
||||
if (w >= 0x8000 && h >= 0x8000)
|
||||
return false;
|
||||
|
||||
buffer.Allocate(w, h, GE_FORMAT_8888, false);
|
||||
|
|
Loading…
Add table
Reference in a new issue