From 9e1e6c599dc0d911fe1888b8a1788a3e1d73117b Mon Sep 17 00:00:00 2001 From: peah Date: Wed, 14 Dec 2016 03:12:20 -0800 Subject: [PATCH] Corrected access of null pointer in audioproc_f: The previous CL that added the ability to add and artificial nearend signal had an issue with null pointer access. This is addressed in this CL. BUG=webrtc:6018 Review-Url: https://codereview.webrtc.org/2573033003 Cr-Commit-Position: refs/heads/master@{#15600} --- .../audio_processing/test/aec_dump_based_simulator.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/webrtc/modules/audio_processing/test/aec_dump_based_simulator.cc b/webrtc/modules/audio_processing/test/aec_dump_based_simulator.cc index 10d4fcdf6f..f444967a10 100644 --- a/webrtc/modules/audio_processing/test/aec_dump_based_simulator.cc +++ b/webrtc/modules/audio_processing/test/aec_dump_based_simulator.cc @@ -230,12 +230,11 @@ void AecDumpBasedSimulator::Process() { << "Only mono files for the artificial nearend are supported, " "reverted to not using the artificial nearend file"; + const int sample_rate_hz = artificial_nearend_file->sample_rate(); artificial_nearend_buffer_reader_.reset( new ChannelBufferWavReader(std::move(artificial_nearend_file))); artificial_nearend_buf_.reset(new ChannelBuffer( - rtc::CheckedDivExact(artificial_nearend_file->sample_rate(), - kChunksPerSecond), - 1)); + rtc::CheckedDivExact(sample_rate_hz, kChunksPerSecond), 1)); } webrtc::audioproc::Event event_msg;