mirror of
https://github.com/srcdslab/sm-ext-voice.git
synced 2025-12-07 10:38:22 +00:00
Prevent crash by adding checks ?
Untested.
This commit is contained in:
parent
46f252f136
commit
72fe7f4ed0
@ -805,6 +805,8 @@ void CVoice::HandleVoiceData()
|
||||
unsigned char aFinal[PacketSize];
|
||||
int FinalSize = 0;
|
||||
|
||||
if (m_pCodec)
|
||||
{
|
||||
FinalSize = celt_encode(m_pCodec, aBuffer, SamplesPerFrame, aFinal, sizeof(aFinal));
|
||||
|
||||
if(FinalSize <= 0)
|
||||
@ -812,6 +814,12 @@ void CVoice::HandleVoiceData()
|
||||
smutils->LogError(myself, "Compress returned %d\n", FinalSize);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
smutils->LogError(myself, "CELT codec is null\n");
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for buffer underruns
|
||||
for(int Client = 0; Client < MAX_CLIENTS; Client++)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user