Ignore descriptors with a zero length; the only data that matters when
recalculating the on-the-wire length are the ones with data, as the goal
is to calculate the length of data that we would have gotten had neither
usbmon nor libpcap truncated the data, and if there's no data to
truncate....
(cherry picked from commit
a879397a5890f48654b4e61ebbf1d4e69d1eb19a)
desc++, bytes_left -= sizeof (usb_isodesc)) {
u_int desc_end;
- desc_end = descs[desc].offset + descs[desc].len;
- if (desc_end > pre_truncation_data_len)
- pre_truncation_data_len = desc_end;
+ if (descs[desc].len != 0) {
+ desc_end = descs[desc].offset + descs[desc].len;
+ if (desc_end > pre_truncation_data_len)
+ pre_truncation_data_len = desc_end;
+ }
}
/*