Fault-injection patch for deterministic reproduction on Windows ASAN. This does NOT bypass any security check. It simulates the transient `Direct3D11CaptureFramePool::Recreate()` failure that the report claims is reachable under GPU memory pressure, so the partial-resize desync (and the resulting OOB read past the mapped staging texture) fires on every shrink->restore cycle instead of probabilistically. Apply, build `chrome` for Windows with is_asan=true, then run poc.html and perform one shrink->restore. ASAN should report a read past the mapped D3D11 staging allocation inside the memcpy loop at wgc_capture_session.cc:720. --- a/third_party/webrtc/modules/desktop_capture/win/wgc_capture_session.cc +++ b/third_party/webrtc/modules/desktop_capture/win/wgc_capture_session.cc @@ -595,9 +595,16 @@ HRESULT WgcCaptureSession::ProcessFrame() { return hr; } - hr = frame_pool_->Recreate(direct3d_device_.Get(), kPixelFormat, - num_buffers(), new_size); + // FAULT INJECTION: simulate Recreate() failing on shrink so that + // mapped_texture_ (already replaced above) is smaller than size_. + if (new_size.Width < size_.Width || new_size.Height < size_.Height) { + hr = E_OUTOFMEMORY; + } else { + hr = frame_pool_->Recreate(direct3d_device_.Get(), kPixelFormat, + num_buffers(), new_size); + } if (FAILED(hr)) { RecordGetFrameResult(GetFrameResult::kRecreateFramePoolFailed); return hr; } }