From 02d166b735fbd1981567ceb5bb703478e2508a56 Mon Sep 17 00:00:00 2001 From: "henrik.lundin@webrtc.org" Date: Mon, 16 Mar 2015 14:33:16 +0000 Subject: [PATCH] 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 --- webrtc/modules/audio_coding/main/acm2/acm_generic_codec.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webrtc/modules/audio_coding/main/acm2/acm_generic_codec.cc b/webrtc/modules/audio_coding/main/acm2/acm_generic_codec.cc index 0f35fe10f8..3a6a6efa23 100644 --- a/webrtc/modules/audio_coding/main/acm2/acm_generic_codec.cc +++ b/webrtc/modules/audio_coding/main/acm2/acm_generic_codec.cc @@ -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();