From 40ec2db012388a38d6e5c5a5dcd3871d3ad10bee Mon Sep 17 00:00:00 2001 From: cloudwalk Date: Sat, 28 Nov 2020 16:08:22 +0000 Subject: [PATCH] prvm_execprogram: Compare against numglobals instead of numglobaldefs. This should be correct... git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13050 d7cf8633-e32d-0410-b094-e92efae38249 --- prvm_execprogram.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/prvm_execprogram.h b/prvm_execprogram.h index 7acd0cc8..a3128062 100644 --- a/prvm_execprogram.h +++ b/prvm_execprogram.h @@ -1020,8 +1020,7 @@ int i; HANDLE_OPCODE(OP_GLOAD_ENT): HANDLE_OPCODE(OP_GLOAD_S): HANDLE_OPCODE(OP_GLOAD_FNC): - // FIXME?: Is this correct? vvvvvvvvvvvvv - if (OPA->_int < 0 || OPA->_int >= prog->numglobaldefs) + if (OPA->_int < 0 || OPA->_int >= prog->numglobals) { PRE_ERROR(); prog->error_cmd("%s Progs attempted to read an invalid indexed global", prog->name); @@ -1031,8 +1030,7 @@ int i; DISPATCH_OPCODE(); HANDLE_OPCODE(OP_GLOAD_V): - // FIXME?: Is this correct? vvvvvvvvvvvvv - if (OPA->_int < 0 || OPA->_int + 2 >= prog->numglobaldefs) + if (OPA->_int < 0 || OPA->_int + 2 >= prog->numglobals) { PRE_ERROR(); prog->error_cmd("%s Progs attempted to read an invalid indexed global", prog->name); -- 2.39.2