Skip to content

screen_connector: use size_t for frame dimensions, strides, and buffer sizes - #3627

Merged
adelva1984 merged 1 commit into
google:mainfrom
adelva1984:fix/screen-connector-size-t
Nov 18, 2026
Merged

adelva1984 merged 1 commit into
google:mainfrom
adelva1984:fix/screen-connector-size-t

Conversation

@adelva1984

Copy link
Copy Markdown
Collaborator

Updates frame dimensions, strides, and buffer size calculations in CompositionManager, DisplayRingBuffer, and DisplayRingBufferManager from int/uint32_t to size_t.

  • Resolves the CodeQL cpp/integer-multiplication-cast-to-long alert at composition_manager.cpp:273 (std::vector<uint8_t>(width * height * 4)) and related overflow risks in composition_manager.cpp and ring_buffer_manager.cpp.
  • Keeps DisplayRingBufferHeader's fixed-width uint32_t shared-memory IPC layout intact, casting at the DisplayRingBufferHeader::set and libyuv::CopyPlane boundaries.

…r sizes

Update frame dimensions, strides, and buffer size calculations in `CompositionManager`, `DisplayRingBuffer`, and `DisplayRingBufferManager` from `int`/`uint32_t` to `size_t`.

This resolves the CodeQL `cpp/integer-multiplication-cast-to-long` alert in `composition_manager.cpp:273` (`width * height * 4`) and related `int`/`uint32_t` multiplication overflow risks in `composition_manager.cpp` and `ring_buffer_manager.cpp`, while keeping `DisplayRingBufferHeader`'s fixed-width `uint32_t` IPC layout intact.

Assisted-by: Jetski:Gemini
@adelva1984
adelva1984 force-pushed the fix/screen-connector-size-t branch from fdb01a0 to d9dec05 Compare November 18, 2026 21:28
@adelva1984
adelva1984 added this pull request to the merge queue Nov 18, 2026
Merged via the queue into google:main with commit a0554b0 Nov 18, 2026
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants