Initialize payload-type frequency in channel.cc.

Uninitialized values triggered divide-by-zero crashes in voe_auto_test.

BUG=
R=stefan@webrtc.org, xians@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4319 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pbos@webrtc.org 2013-07-10 10:06:29 +00:00
parent 28e2075280
commit 08933a5dfb
3 changed files with 5 additions and 0 deletions

View File

@ -304,6 +304,7 @@ class RTPPayloadAudioStrategy : public RTPPayloadStrategy {
ModuleRTPUtility::Payload* payload = new ModuleRTPUtility::Payload;
payload->name[RTP_PAYLOAD_NAME_SIZE - 1] = 0;
strncpy(payload->name, payloadName, RTP_PAYLOAD_NAME_SIZE - 1);
assert(frequency >= 1000);
payload->typeSpecific.Audio.frequency = frequency;
payload->typeSpecific.Audio.channels = channels;
payload->typeSpecific.Audio.rate = rate;

View File

@ -334,6 +334,8 @@ bool RtpReceiverImpl::RetransmitOfOldPacket(const RTPHeader& header,
CriticalSectionScoped cs(critical_section_rtp_receiver_);
uint32_t frequency_khz = header.payload_type_frequency / 1000;
assert(frequency_khz > 0);
int64_t time_diff_ms = clock_->TimeInMilliseconds() -
last_receive_time_;

View File

@ -2182,6 +2182,8 @@ int32_t Channel::ReceivedRTPPacket(const int8_t* data, int32_t length) {
"IncomingPacket invalid RTP header");
return -1;
}
header.payload_type_frequency =
rtp_payload_registry_->GetPayloadTypeFrequency(header.payloadType);
bool retransmitted = IsPacketRetransmitted(header);
bool in_order = rtp_receiver_->InOrderPacket(header.sequenceNumber);
rtp_receive_statistics_->IncomingPacket(header, static_cast<uint16_t>(length),