diff --git a/webrtc/media/engine/fakewebrtcvideocapturemodule.h b/webrtc/media/engine/fakewebrtcvideocapturemodule.h index 3202502e6c..2bc715b1e1 100644 --- a/webrtc/media/engine/fakewebrtcvideocapturemodule.h +++ b/webrtc/media/engine/fakewebrtcvideocapturemodule.h @@ -87,11 +87,16 @@ class FakeWebRtcVideoCaptureModule : public webrtc::VideoCaptureModule { void SendFrame(int w, int h) { if (!running_) return; - webrtc::VideoFrame sample; - // Setting stride based on width. - sample.CreateEmptyFrame(w, h, w, (w + 1) / 2, (w + 1) / 2); + + rtc::scoped_refptr buffer = + new rtc::RefCountedObject(w, h); + // Initialize memory to satisfy DrMemory tests. See + // https://bugs.chromium.org/p/libyuv/issues/detail?id=377 + buffer->InitializeData(); if (callback_) { - callback_->OnIncomingCapturedFrame(id_, sample); + callback_->OnIncomingCapturedFrame( + id_, + webrtc::VideoFrame(buffer, 0, 0, webrtc::kVideoRotation_0)); } }