From 77f4ddf2c2912436769b3073c0ac8e1b04c7f50f Mon Sep 17 00:00:00 2001 From: Asher Baker Date: Fri, 18 Oct 2019 00:23:45 +0100 Subject: [PATCH] Fix virtual SDKCall with object params (#1104) PR #705 made some changes for 64-bit support that required callers to provide a buffer for object storage, but only added the required code to the non-virtual call builder, not the virtual call builder. Copy it over to CreateValveVCall so that ValveParamToBinParam stops writing to a null pointer. Fixes #1059 (Hopefully.) --- extensions/sdktools/vcallbuilder.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extensions/sdktools/vcallbuilder.cpp b/extensions/sdktools/vcallbuilder.cpp index 22ffe11b..36d3a1f5 100644 --- a/extensions/sdktools/vcallbuilder.cpp +++ b/extensions/sdktools/vcallbuilder.cpp @@ -255,10 +255,12 @@ ValveCall *CreateValveVCall(unsigned int vtableIdx, /* Get return information - encode only */ PassInfo retBuf; + ObjectField retFieldBuf[16]; size_t retBufSize = 0; bool retbuf_needs_extra; if (retInfo) { + retBuf.fields = retFieldBuf; if ((size = ValveParamToBinParam(retInfo->vtype, retInfo->type, retInfo->flags, &retBuf, retbuf_needs_extra)) == 0) { delete vc; @@ -269,12 +271,14 @@ ValveCall *CreateValveVCall(unsigned int vtableIdx, /* Get parameter info */ PassInfo paramBuf[32]; + ObjectField fieldBuf[32][16]; size_t sizes[32]; size_t normSize = 0; size_t extraSize = 0; for (unsigned int i=0; i