From ac7e309820eb3e8c24ef26d952dec0730a3d5075 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sun, 12 Jan 2014 18:01:02 -0600 Subject: Don't read clc.voipIncomingSequence until range checked sender --- src/client/cl_parse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/client') diff --git a/src/client/cl_parse.c b/src/client/cl_parse.c index 077a6218..a8b68ca5 100644 --- a/src/client/cl_parse.c +++ b/src/client/cl_parse.c @@ -703,7 +703,7 @@ void CL_ParseVoip ( msg_t *msg ) { const int packetsize = MSG_ReadShort(msg); const int flags = MSG_ReadBits(msg, VOIP_FLAGCNT); char encoded[1024]; - int seqdiff = sequence - clc.voipIncomingSequence[sender]; + int seqdiff; int written = 0; int i; @@ -747,6 +747,8 @@ void CL_ParseVoip ( msg_t *msg ) { Com_DPrintf("VoIP: packet accepted!\n"); + seqdiff = sequence - clc.voipIncomingSequence[sender]; + // This is a new "generation" ... a new recording started, reset the bits. if (generation != clc.voipIncomingGeneration[sender]) { Com_DPrintf("VoIP: new generation %d!\n", generation); -- cgit