MarshallOfSound

#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 require content_rect to fit coded_size and 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_size before reading it.
  • Log instead of CHECK when CreateLayeredWindowUpdater reaches 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 test passes

Release Notes

Notes: none

Backports

42-x-y
Merged
PR Number
#54047
Merged At
Sep 17, 2026, 5:55:44 PM
Released In
Not yet
Release Date
Not yet
43-x-y
Merged
PR Number
#54037
Merged At
Sep 17, 2026, 5:48:57 PM
Released In
Not yet
Release Date
Not yet
44-x-y
Merged
PR Number
#54036
Merged At
Sep 17, 2026, 5:31:59 PM
Released In
Not yet
Release Date
Not yet
45-x-y
Merged
PR Number
#54038
Merged At
Sep 17, 2026, 6:19:15 PM
Released In
Not yet
Release Date
Not yet

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