Fix data race for RTCPReceiver stats callback.

Annotates the callback which identifies the bug, then fixes it.

R=stefan@webrtc.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#8390}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8390 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
index 25a4756..62d6676 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
@@ -770,6 +770,7 @@
 
   cnameInfo->name[RTCP_CNAME_SIZE - 1] = 0;
   strncpy(cnameInfo->name, rtcpPacket.CName.CName, RTCP_CNAME_SIZE - 1);
+  CriticalSectionScoped lock(_criticalSectionFeedbacks);
   if (stats_callback_ != NULL) {
     stats_callback_->CNameChanged(rtcpPacket.CName.CName,
                                   rtcpPacket.CName.SenderSSRC);
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.h b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.h
index a52e810..46d10f7 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.h
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.h
@@ -274,7 +274,7 @@
   // delivered RTP packet to the remote side.
   int64_t _lastIncreasedSequenceNumberMs;
 
-  RtcpStatisticsCallback* stats_callback_;
+  RtcpStatisticsCallback* stats_callback_ GUARDED_BY(_criticalSectionFeedbacks);
 
   RtcpPacketTypeCounter packet_type_counter_;