Fixing a race condition in ACMGenericCodec

The old object was deleted before the pointer to it was removed from
the decoder proxy.

BUG=chromium:467209
TBR=tina.legrand@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/49429004

Cr-Commit-Position: refs/heads/master@{#8736}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8736 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrik.lundin@webrtc.org 2015-03-16 14:33:16 +00:00
parent 3f11823a1a
commit 02d166b735

View File

@ -339,8 +339,8 @@ void ACMGenericCodec::ResetAudioEncoder() {
config.payload_type = codec_inst.pltype;
enc_dec = new AudioEncoderDecoderIsacFix(config);
}
audio_encoder_.reset(enc_dec);
decoder_proxy_.SetDecoder(enc_dec);
audio_encoder_.reset(enc_dec);
#endif
#ifdef WEBRTC_CODEC_ISAC
} else if (!STR_CASE_CMP(codec_inst.plname, "ISAC")) {
@ -368,8 +368,8 @@ void ACMGenericCodec::ResetAudioEncoder() {
config.payload_type = codec_inst.pltype;
enc_dec = new AudioEncoderDecoderIsac(config);
}
audio_encoder_.reset(enc_dec);
decoder_proxy_.SetDecoder(enc_dec);
audio_encoder_.reset(enc_dec);
#endif
} else {
FATAL();