mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
SoftGPU: Fix crash on garbage index data.
This commit is contained in:
parent
0f880696be
commit
aa3b026bfe
1 changed files with 5 additions and 1 deletions
|
@ -581,12 +581,16 @@ bool TransformUnit::GetCurrentSimpleVertices(int count, std::vector<GPUDebugVert
|
||||||
|
|
||||||
static std::vector<u32> temp_buffer;
|
static std::vector<u32> temp_buffer;
|
||||||
static std::vector<SimpleVertex> simpleVertices;
|
static std::vector<SimpleVertex> simpleVertices;
|
||||||
temp_buffer.resize(65536 * 24 / sizeof(u32));
|
temp_buffer.resize(std::max((int)indexUpperBound, 8192) * 128 / sizeof(u32));
|
||||||
simpleVertices.resize(indexUpperBound + 1);
|
simpleVertices.resize(indexUpperBound + 1);
|
||||||
|
|
||||||
VertexDecoder vdecoder;
|
VertexDecoder vdecoder;
|
||||||
VertexDecoderOptions options{};
|
VertexDecoderOptions options{};
|
||||||
vdecoder.SetVertexType(gstate.vertType, options);
|
vdecoder.SetVertexType(gstate.vertType, options);
|
||||||
|
|
||||||
|
if (!Memory::IsValidRange(gstate_c.vertexAddr, (indexUpperBound + 1) * vdecoder.VertexSize()))
|
||||||
|
return false;
|
||||||
|
|
||||||
DrawEngineCommon::NormalizeVertices((u8 *)(&simpleVertices[0]), (u8 *)(&temp_buffer[0]), Memory::GetPointer(gstate_c.vertexAddr), &vdecoder, indexLowerBound, indexUpperBound, gstate.vertType);
|
DrawEngineCommon::NormalizeVertices((u8 *)(&simpleVertices[0]), (u8 *)(&temp_buffer[0]), Memory::GetPointer(gstate_c.vertexAddr), &vdecoder, indexLowerBound, indexUpperBound, gstate.vertType);
|
||||||
|
|
||||||
float world[16];
|
float world[16];
|
||||||
|
|
Loading…
Add table
Reference in a new issue