Fix crash when accessing invalid argument index
Just return null if a user tries to access an invalid argument that wasn't defined when detouring the function.
This commit is contained in:
@@ -129,6 +129,9 @@ int x86MsCdecl::GetArgRegisterSize()
|
||||
|
||||
void* x86MsCdecl::GetArgumentPtr(int iIndex, CRegisters* pRegisters)
|
||||
{
|
||||
if (iIndex < 0 || iIndex >= m_vecArgTypes.length())
|
||||
return NULL;
|
||||
|
||||
// Check if this argument was passed in a register.
|
||||
if (m_vecArgTypes[iIndex].custom_register != None)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user