Skip to content

graphics_detector: use size_t for image dimensions and coordinates - #3626

Merged
adelva1984 merged 1 commit into
google:mainfrom
adelva1984:fix/graphics-detector-image-overflow
Nov 18, 2026
Merged

adelva1984 merged 1 commit into
google:mainfrom
adelva1984:fix/graphics-detector-image-overflow

Conversation

@adelva1984

Copy link
Copy Markdown
Collaborator

Switches image dimensions, coordinates, and buffer offset calculations in base/cvd/cuttlefish/host/graphics_detector/image.h and image.cpp from uint32_t to size_t.

This resolves CodeQL cpp/integer-multiplication-cast-to-long alerts ("Multiplication result may overflow 'unsigned int' before it is converted to 'size_type'") on image.cpp:77, 210, 258, 259, and 260, as well as related stride/offset calculations.

@adelva1984
adelva1984 requested review from jmacnak and ser-io November 18, 2026 20:56
Switch image dimensions, coordinates, and buffer offset calculations in `image.h` and `image.cpp` from `uint32_t` to `size_t` to resolve CodeQL `cpp/integer-multiplication-cast-to-long` alerts where `uint32_t` multiplications could overflow before widening to `size_t`.

Assisted-by: Jetski:Gemini
@adelva1984
adelva1984 force-pushed the fix/graphics-detector-image-overflow branch from bb79f8d to b641152 Compare November 18, 2026 21:29
@adelva1984
adelva1984 added this pull request to the merge queue Nov 18, 2026
Merged via the queue into google:main with commit 002ccec 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.

3 participants