Fix race condition in RTPSEnder.

In RTPSender::SendPayloadType(), payload_type_ should not be read
without owning send_critsect_.

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

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5778 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
sprang@webrtc.org 2014-03-25 16:51:35 +00:00
parent ff7908abfd
commit efcad39f77
2 changed files with 5 additions and 2 deletions

View File

@ -275,7 +275,10 @@ int32_t RTPSender::DeRegisterSendPayload(
return 0;
}
int8_t RTPSender::SendPayloadType() const { return payload_type_; }
int8_t RTPSender::SendPayloadType() const {
CriticalSectionScoped cs(send_critsect_);
return payload_type_;
}
int RTPSender::SendPayloadFrequency() const {
return audio_ != NULL ? audio_->AudioFrequency() : kVideoPayloadTypeFrequency;

View File

@ -344,7 +344,7 @@ class RTPSender : public RTPSenderInterface, public Bitrate::Observer {
uint16_t target_send_bitrate_;
uint16_t packet_over_head_;
int8_t payload_type_;
int8_t payload_type_ GUARDED_BY(send_critsect_);
std::map<int8_t, ModuleRTPUtility::Payload *> payload_type_map_;
RtpHeaderExtensionMap rtp_header_extension_map_;