Skip to content
Permalink
Browse files

Reduce probability for possible race until a real fix can be implemented

- p's target might be invalidated in the time between retrieving it and using it. https://mumble.hive.no/crashes/win32/1.2.4-145-g442b46e/2013-09-13T23:16%201.2.5%201.2.4-145-g442b46e%20Unknown.html seems to indicates that this happened at least once in Line 809 of AudioInput.cpp (mind the inlines).
- Should be fixed properly by using smart-pointers or removing this data interdependence between threads
  • Loading branch information...
hacst committed Sep 14, 2013
1 parent fc24262 commit 860ec5c7231aacf8fb98009eeb415dd3ddc8535e
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/mumble/AudioInput.cpp
@@ -706,7 +706,6 @@ int AudioInput::encodeCELTFrame(short *psSource, unsigned char *buffer) {

void AudioInput::encodeAudioFrame() {
int iArg;
ClientUser *p=ClientUser::get(g.uiSession);
int i;
float sum;
short max;
@@ -790,6 +789,7 @@ void AudioInput::encodeAudioFrame() {

bIsSpeech = bIsSpeech || (g.iPushToTalk > 0);

ClientUser *p = ClientUser::get(g.uiSession);
if (g.s.bMute || ((g.s.lmLoopMode != Settings::Local) && p && (p->bMute || p->bSuppress)) || g.bPushToMute || (g.iTarget < 0)) {
bIsSpeech = false;
}

0 comments on commit 860ec5c

Please sign in to comment.
You can’t perform that action at this time.