GPU: Fix out-of-bounds read in GP1(10h)

This commit is contained in:
Connor McLaughlin 2019-10-06 00:37:31 +10:00
parent 24bda8f659
commit b7209eafb1
2 changed files with 4 additions and 4 deletions

View file

@ -615,7 +615,7 @@ void GPU::WriteGP1(u32 value)
case 0x1E: case 0x1E:
case 0x1F: case 0x1F:
{ {
HandleGetGPUInfoCommand(); HandleGetGPUInfoCommand(value);
} }
break; break;
@ -625,9 +625,9 @@ void GPU::WriteGP1(u32 value)
} }
} }
void GPU::HandleGetGPUInfoCommand() void GPU::HandleGetGPUInfoCommand(u32 value)
{ {
const u8 subcommand = Truncate8(m_GP0_command[0] & 0x07); const u8 subcommand = Truncate8(value & 0x07);
switch (subcommand) switch (subcommand)
{ {
case 0x00: case 0x00:

View file

@ -181,7 +181,7 @@ protected:
u32 ReadGPUREAD(); u32 ReadGPUREAD();
void WriteGP0(u32 value); void WriteGP0(u32 value);
void WriteGP1(u32 value); void WriteGP1(u32 value);
void HandleGetGPUInfoCommand(); void HandleGetGPUInfoCommand(u32 value);
// Rendering commands, returns false if not enough data is provided // Rendering commands, returns false if not enough data is provided
bool HandleRenderCommand(); bool HandleRenderCommand();