#54033: fix: validate captured frame layout before reading it
Merged
Created: Sep 17, 2026, 1:52:11 PM
Merged: Sep 17, 2026, 3:09:12 PM
7 comments
Target: main
Description of Change
Check the layout that comes with each captured frame against the buffer behind it before wrapping that buffer in a bitmap.
beginFrameSubscription: only accept ARGB shared-memory frames, and requirecontent_rectto fitcoded_sizeand the mapping (same check the offscreen video consumer already has).- Offscreen rendering: drop frames with an unexpected buffer type or pixel format instead of
CHECKing. - Offscreen rendering on macOS without GPU compositing: check the IOSurface exists and covers
pixel_sizebefore reading it. - Log instead of
CHECKwhenCreateLayeredWindowUpdaterreaches a display client that isn't doing offscreen rendering.
Checklist
- I have filled out the PR description
- I have built and tested this change
-
npm testpasses
Release Notes
Notes: none
Backports
Semver Impact
Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron