Race condition in ViECapturer::RegisterObserver

Critical section ViECapturer.observer_cs_ should be taken when
registering an observer.

BUG=2734
R=mflodman@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5326 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
sprang@webrtc.org 2013-12-20 11:36:03 +00:00
parent a463d73b99
commit 8dbca8d665

View File

@ -638,6 +638,7 @@ bool ViECapturer::CaptureCapabilityFixed() {
}
int32_t ViECapturer::RegisterObserver(ViECaptureObserver* observer) {
CriticalSectionScoped cs(observer_cs_.get());
if (observer_) {
WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(engine_id_, capture_id_),
"%s Observer already registered", __FUNCTION__, capture_id_);