Skip to content

fix(python): validate dimensions in list_to_2d_float_array - #9799

Open
Bartok (Bartok9) wants to merge 1 commit into
microsoft:mainfrom
Bartok9:aerial/fix-list-to-2d-shape-20260722
Open

Bartok (Bartok9) wants to merge 1 commit into
microsoft:mainfrom
Bartok9:aerial/fix-list-to-2d-shape-20260722

Conversation

@Bartok9

Copy link
Copy Markdown

What

list_to_2d_float_array now rejects negative sizes and length mismatches with an explicit ValueError instead of leaking numpy reshape noise. Empty 0×0 buffers remain valid.

Why

Depth helpers sometimes feed truncated flat buffers after empty image responses; clearer fail-closed errors help API callers.

Test plan

  • python3 PythonClient/airsim/tests/test_utils_reshape.py -v (4 tests)
  • Happy-path 2×2 reshape
  • length mismatch / negative dim paths

Does not touch string_to_* / write_file (see open #9795 / #9796).

Reject negative sizes and length mismatches with an explicit ValueError
instead of an opaque numpy reshape failure. Soft-empty 0x0 buffers stay
supported. Offline unit tests included (no simulator).

Signed-off-by: Bartok9 <danielrpike9@gmail.com>
@Bartok9
Bartok (Bartok9) force-pushed the aerial/fix-list-to-2d-shape-20260722 branch from f80bbf1 to 379a15e Compare October 25, 2026 21:27

This branch has not been deployed

No deployments
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.

1 participant