GE Debugger: Fix crash on 0 count prim.

This commit is contained in:
Unknown W. Brackets 2022-08-14 16:17:04 -07:00
parent 132686513d
commit daaf448d22
2 changed files with 4 additions and 1 deletions

View File

@ -266,7 +266,7 @@ bool DrawEngineCommon::GetCurrentSimpleVertices(int count, std::vector<GPUDebugV
u16 indexLowerBound = 0;
u16 indexUpperBound = count - 1;
if (!Memory::IsValidAddress(gstate_c.vertexAddr))
if (!Memory::IsValidAddress(gstate_c.vertexAddr) || count == 0)
return false;
bool savedVertexFullAlpha = gstate_c.vertexFullAlpha;

View File

@ -813,6 +813,9 @@ bool TransformUnit::GetCurrentSimpleVertices(int count, std::vector<GPUDebugVert
u16 indexLowerBound = 0;
u16 indexUpperBound = count - 1;
if (!Memory::IsValidAddress(gstate_c.vertexAddr) || count == 0)
return false;
if (count > 0 && (gstate.vertType & GE_VTYPE_IDX_MASK) != GE_VTYPE_IDX_NONE) {
const u8 *inds = Memory::GetPointer(gstate_c.indexAddr);
const u16_le *inds16 = (const u16_le *)inds;