From c5330c73b75c242041dff98cf13468363bea718a Mon Sep 17 00:00:00 2001 From: Scott Ehlert Date: Fri, 2 May 2008 07:47:38 +0000 Subject: [PATCH] Attempted fix for amb1648 - stack corruption when GetClientEyeAngles() is called on Windows --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402124 --- extensions/sdktools/vhelpers.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/extensions/sdktools/vhelpers.cpp b/extensions/sdktools/vhelpers.cpp index 6c7dfec6..35eea306 100644 --- a/extensions/sdktools/vhelpers.cpp +++ b/extensions/sdktools/vhelpers.cpp @@ -160,12 +160,12 @@ bool SetupGetEyeAngles() int offset; if (g_pGameConf->GetOffset("EyeAngles", &offset)) { - PassInfo info[2]; - info[0].flags = info[1].flags = PASSFLAG_BYVAL; - info[0].size = info[1].size = sizeof(void *); - info[0].type = info[1].type = PassType_Basic; + PassInfo info[1]; + info[0].flags = PASSFLAG_BYVAL; + info[0].size = sizeof(void *); + info[0].type = PassType_Basic; - s_EyeAngles.call = g_pBinTools->CreateVCall(offset, 0, 0, &info[0], &info[1], 1); + s_EyeAngles.call = g_pBinTools->CreateVCall(offset, 0, 0, info, NULL, 0); if (s_EyeAngles.call != NULL) { @@ -190,7 +190,6 @@ bool GetEyeAngles(CBaseEntity *pEntity, QAngle *pAngles) unsigned char *vptr = params; *(CBaseEntity **)vptr = pEntity; - vptr += sizeof(CBaseEntity *); s_EyeAngles.call->Execute(params, &pRetAngle);