mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Engine: check for bitbuf overflow after reading voice data
This commit is contained in:
parent
d1c4d6f1d6
commit
442f28e6cc
@ -537,6 +537,9 @@ bool CClient::VProcessVoiceData(CClient* pClient, CLC_VoiceData* pMsg)
|
||||
char voiceDataBuffer[4096];
|
||||
const int bitsRead = pMsg->m_DataIn.ReadBitsClamped(voiceDataBuffer, pMsg->m_nLength);
|
||||
|
||||
if (pMsg->m_DataIn.IsOverflowed())
|
||||
return false;
|
||||
|
||||
CClient* const pAdj = AdjustShiftedThisPointer(pClient);
|
||||
SV_BroadcastVoiceData(pAdj, Bits2Bytes(bitsRead), voiceDataBuffer);
|
||||
#endif // !CLIENT_DLL
|
||||
@ -556,6 +559,9 @@ bool CClient::VProcessDurangoVoiceData(CClient* pClient, CLC_DurangoVoiceData* p
|
||||
char voiceDataBuffer[4096];
|
||||
const int bitsRead = pMsg->m_DataIn.ReadBitsClamped(voiceDataBuffer, pMsg->m_nLength);
|
||||
|
||||
if (pMsg->m_DataIn.IsOverflowed())
|
||||
return false;
|
||||
|
||||
CClient* const pAdj = AdjustShiftedThisPointer(pClient);
|
||||
SV_BroadcastDurangoVoiceData(pAdj, Bits2Bytes(bitsRead), voiceDataBuffer,
|
||||
pMsg->m_xid, pMsg->m_unknown, pMsg->m_useVoiceStream, pMsg->m_skipXidCheck);
|
||||
|
Loading…
x
Reference in New Issue
Block a user