Commit 0cfbc97
Fix WMF get_xu_range() truncating multi-byte XU control ranges to 4 bytes
ReadFromBuffer() capped every min/max/step/def copy at
min(sizeof(uint32_t), length) - correct for classic scalar PU/CT controls
(a value is genuinely at most a 4-byte int there), but silently truncated
composite XU controls whose real wire size exceeds 4 bytes: the
destination vector was correctly sized to the full option_range_size, yet
only its first 4 bytes were ever populated from the device's real
response, leaving every field past that offset at std::vector's zero-init
default regardless of what the device actually reported.
Confirmed against a real D555 running RS2_COMPOSITE_OPTION_HKR_MINZ_CONTROL
(38-byte rs2_minz_control): get_composite_option_range_as() previously
returned all-zero bounds for every field past ctl_id; after this fix it
returns real, sane values matching the documented ranges in
rs_hkr_minz_control.h (e.g. disparity_shift max=512, threshold max=65535,
step=1 across the board). Verified scalar option ranges (Exposure, Gain,
Laser Power, etc.) are unaffected, since length was already <=4 there.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent c05c215 commit 0cfbc97
1 file changed
Lines changed: 14 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
357 | | - | |
358 | | - | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
359 | 367 | | |
360 | 368 | | |
361 | 369 | | |
| |||
370 | 378 | | |
371 | 379 | | |
372 | 380 | | |
373 | | - | |
| 381 | + | |
374 | 382 | | |
375 | 383 | | |
376 | | - | |
| 384 | + | |
377 | 385 | | |
378 | 386 | | |
379 | | - | |
| 387 | + | |
380 | 388 | | |
381 | 389 | | |
382 | 390 | | |
| |||
394 | 402 | | |
395 | 403 | | |
396 | 404 | | |
397 | | - | |
| 405 | + | |
398 | 406 | | |
399 | 407 | | |
400 | 408 | | |
| |||
0 commit comments