From fddf0200db87a883a0c869e4b9cfdf3ff444e877 Mon Sep 17 00:00:00 2001 From: Sergey Degtyar Date: Thu, 3 Jul 2025 13:36:25 +0300 Subject: [PATCH] engine: client: replaced hardcoded buffer sizes with defined constants for voice data --- engine/client/cl_parse.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index 554c12f3..ac31fb2f 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -2011,7 +2011,7 @@ CL_ParseVoiceData void CL_ParseVoiceData( sizebuf_t *msg, connprotocol_t proto ) { int size, idx, frames = 0; - byte received[8192]; + byte received[VOICE_MAX_DATA_SIZE]; idx = MSG_ReadByte( msg ) + 1; @@ -2021,7 +2021,7 @@ void CL_ParseVoiceData( sizebuf_t *msg, connprotocol_t proto ) if( proto == PROTO_GOLDSRC ) { size = MSG_ReadShort( msg ); - if ( size > 4096 ) + if ( size > VOICE_MAX_GS_DATA_SIZE ) { Con_Printf( S_ERROR "Voice data size is too large: %d bytes (max: %d)\n", size, VOICE_MAX_GS_DATA_SIZE ); return; @@ -2031,7 +2031,7 @@ void CL_ParseVoiceData( sizebuf_t *msg, connprotocol_t proto ) { frames = MSG_ReadByte( msg ); size = MSG_ReadShort( msg ); - if (size > 8192 ) + if (size > VOICE_MAX_DATA_SIZE ) { Con_Printf( S_ERROR "Voice data size is too large: %d bytes (max: %d)\n", size, VOICE_MAX_DATA_SIZE ); return;