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:
Peace-Maker
2018-04-18 00:57:58 +02:00
parent 9bbca712b6
commit b16d1f9f3f
3 changed files with 15 additions and 3 deletions
+3
View File
@@ -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)
{