mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 21:39:52 +00:00
Don't allow boneMatrixNumber to go outside bounds.
Just from the GLES code. Fixes the Monster Hunter 3rd demo crash, but not sure why it's trying to use crazy numbers in the first place...
This commit is contained in:
parent
dc81547d32
commit
8ddbc0a9ab
@ -857,18 +857,30 @@ void SoftGPU::ExecuteOp(u32 op, u32 diff)
|
||||
break;
|
||||
|
||||
case GE_CMD_TGENMATRIXDATA:
|
||||
DEBUG_LOG(G3D,"DL TGEN matrix data # %f", getFloat24(data));
|
||||
gstate.tgenMatrix[gstate.texmtxnum++] = getFloat24(data);
|
||||
{
|
||||
DEBUG_LOG(G3D,"DL TGEN matrix data # %f", getFloat24(data));
|
||||
int num = gstate.texmtxnum & 0xF;
|
||||
if (num < 12) {
|
||||
gstate.tgenMatrix[num] = getFloat24(data);
|
||||
}
|
||||
gstate.texmtxnum = (++num) & 0xF;
|
||||
}
|
||||
break;
|
||||
|
||||
case GE_CMD_BONEMATRIXNUMBER:
|
||||
DEBUG_LOG(G3D,"DL BONE matrix #%i", data);
|
||||
gstate.boneMatrixNumber = data;
|
||||
gstate.boneMatrixNumber = data & 0x7F;
|
||||
break;
|
||||
|
||||
case GE_CMD_BONEMATRIXDATA:
|
||||
DEBUG_LOG(G3D,"DL BONE matrix data #%i %f", gstate.boneMatrixNumber, getFloat24(data));
|
||||
gstate.boneMatrix[gstate.boneMatrixNumber++] = getFloat24(data);
|
||||
{
|
||||
DEBUG_LOG(G3D,"DL BONE matrix data #%i %f", gstate.boneMatrixNumber, getFloat24(data));
|
||||
int num = gstate.boneMatrixNumber & 0x7F;
|
||||
if (num < 96) {
|
||||
gstate.boneMatrix[num] = getFloat24(data);
|
||||
}
|
||||
gstate.boneMatrixNumber = (++num) & 0x7F;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user