Repository navigation
webrtc: widen screenshot buffer size and offset arithmetic to size_t - #3628
Merged
adelva1984 merged 1 commit intoNov 19, 2026
Merged
Conversation
Cast `int` width/stride/row operands to `size_t` before multiplication in `screenshot_handler.cpp` (`FrameToRgb`, `PngScreenshot`, and `JpegScreenshot`). This resolves the CodeQL `cpp/integer-multiplication-cast-to-long` alert at `screenshot_handler.cpp:45` and related buffer size/offset calculations. Assisted-by: Jetski:Gemini
Collaborator
Author
|
Alternatives considered: use an unsigned type in VideoFrameBuffer subclass, but this ends up not mixing so well with upstream webrtc's lazy use of the int datatype. |
adelva1984
requested review from
Databean and
jemoreira
and removed request for
Databean
November 18, 2026 21:17
Databean
approved these changes
Nov 18, 2026
Member
|
There were some issues using More pedantically correct would be |
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Casts
intwidth/stride/row operands tosize_tbefore multiplication inbase/cvd/cuttlefish/host/frontend/webrtc/screenshot_handler.cpp(FrameToRgb,PngScreenshot, andJpegScreenshot).Resolves the CodeQL
cpp/integer-multiplication-cast-to-longalert atscreenshot_handler.cpp:45and related buffer size/offset calculations.