Fix OBU parser overflows for extremely large packet sizes
The previous implementation was using unsigned
to count bits, which would overflow for sizes > UINT_MAX/8
. Furthermore, using int
as return value is insufficient on 64-bit systems as OBU lengths can technically go up to UINT32_MAX
bytes (plus a few bytes for the header).