From eb764b3b75fa4dc2c49a7af8744d84adae99b9f1 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Fri, 9 Dec 2011 19:10:35 +0000 Subject: [PATCH] gameexec.c: fix calculation of a pointer value outside the bounds of an array and an invalid derived pointer value. git-svn-id: https://svn.eduke32.com/eduke32@2166 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/gameexec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index bea263201..f9f5148f1 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -94,8 +94,10 @@ void VM_OnEvent(register int32_t iEventID, register int32_t iActor, register int { intptr_t *oinsptr=insptr; vmstate_t vm_backup; - vmstate_t tempvm = { iActor, iPlayer, lDist, &actor[iActor].t_data[0], - &sprite[iActor], 0 }; + vmstate_t tempvm = { iActor, iPlayer, lDist, + iActor >= 0 ? &actor[iActor].t_data[0] : NULL, + iActor >= 0 ? &sprite[iActor] : NULL, + 0 }; g_currentEventExec = iEventID; insptr = apScriptGameEvent[iEventID];