gpu: reject invalid pixel readback dimensions before device setup #2239
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2247"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T07:33:20Z.
The pixel readback CLI accepted a numeric prefix for either dimension. I drew an 8 × 4 synthetic triangle on WARP with a 32-pixel reference. The valid invocation, a width of
8x4, and a height of4junkall returned 0 withall 32 pixels matched.Validate the complete base-10 values during CLI resolution, before adapter selection or file access. Both dimensions must be in the inclusive range 1–64. The parser keeps the earlier behavior for valid values such as
08and+4. The existing CLI self-test covers both positions, the limits, decimal fractions, suffixes and overflow.Windows 2025 verification at bfb1f61a built the exact revision with MSVC and ran:
offscreen_capability_table_self_testand the existingstartup_gfx2hlsl_dpp_quad_swap_warpdraw, both passed.8x4 4and8 4junk. Both returned usage exit 2 before GPU setup.The documentation link check (419 links), bidirectional controls check and
git diff --checkalso passed.Reproduce the two CTests with
ctest --preset dev --no-tests=error -V -R '^(offscreen_capability_table_self_test|startup_gfx2hlsl_dpp_quad_swap_warp)$'.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T07:41:41Z.
Review: COMMENTED
Review of head
bfb1f61ae5a1279c28e759ee2a92717d74a85bec(onlytests/offscreen_check.cpp).Findings: 0 P1, 0 P2.
--startup-pixel-wordswidth/height are now validated in the CLI table (validate_pixel_words_args) before any device setup, so a bad extent exits with usage error (2) instead of failing late.pixel_extentuses strtol with full-string match and a 1..64 range; empty, trailing junk, decimals, 0, 65, negatives and overflow are rejected;08and+4stay accepted (same as the old stoul parsing). The argc check runs before the validator, soargv[5]/argv[6]are always present (argc is 8).check_clitable inrun_self_test(good and bad extents on both positions). No concurrent open or recent merged PR touches this operation.Commands executed locally:
git diff --stat origin/main...HEAD(1 file, +23/-10)python3 tests/docs_links_check.pyPASS,python3 tests/bidi_controls_check.pyPASS,git diff --check origin/main...HEADcleanpixel_extentwith the same good/bad cases. Upper bound 64 -> 65 givesfailures=1(the65case), the original givesfailures=0.python3 x2w_pipe.py win2025 2247 --scope direct --targets offscreen_check --regex 'offscreen_capability_table_self_test|startup_pixel_words'-> Debug (dev) 1/1 passed, Release /O2 1/1 passed (offscreen_capability_table_self_test).Build and test on WindowsSUCCESS.AI-assisted; commands listed were executed locally.
upstream-sync referenced this pull request2026-11-25 21:01:24 +00:00