From f6f033f8bd0875cab0f2d92c8a9aadcfb9cbf4b6 Mon Sep 17 00:00:00 2001 From: "tina.legrand@webrtc.org" Date: Wed, 3 Jul 2013 12:00:14 +0000 Subject: [PATCH] Possible divide by 0 in ACM. BUG=https://code.google.com/p/webrtc/issues/detail?id=1551 R=turaj@webrtc.org Review URL: https://webrtc-codereview.appspot.com/1757004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4291 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../audio_coding/main/source/audio_coding_module_impl.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webrtc/modules/audio_coding/main/source/audio_coding_module_impl.cc b/webrtc/modules/audio_coding/main/source/audio_coding_module_impl.cc index ba15921bc..d895ba7cd 100644 --- a/webrtc/modules/audio_coding/main/source/audio_coding_module_impl.cc +++ b/webrtc/modules/audio_coding/main/source/audio_coding_module_impl.cc @@ -3055,7 +3055,8 @@ void AudioCodingModuleImpl::UpdateBufferingSafe(const WebRtcRTPHeader& rtp_info, const int in_sample_rate_khz = (ACMCodecDB::database_[current_receive_codec_idx_].plfreq / 1000); if (first_payload_received_ && - rtp_info.header.timestamp > last_incoming_send_timestamp_) { + rtp_info.header.timestamp > last_incoming_send_timestamp_ && + in_sample_rate_khz > 0) { accumulated_audio_ms_ += (rtp_info.header.timestamp - last_incoming_send_timestamp_) / in_sample_rate_khz; }