Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix incorrect multiple-count report field sizing
- Add `HIDInputReportItem::get_total_size()`, the item's size times its count - Use `HIDInputReportItem::get_total_size()` to calculate the correct item offset in `HIDInputReport::push_back` Offsets for `HIDInputReportItem` instances within a report are calculated using the size of the field, but the message will contain N fields of the given size. As a result, multiple-count fields give every following `HIDInputReportItem` an incorrect offset when parsing HID reports. In addition, the report's calculated total size is incorrect, which would cause issues with any code that might rely on its size in the future. Introducing a member to provide the correct total size allows correct calculation of a report's size.
- Loading branch information