| 440 | } |
| 441 | |
| 442 | static bool ReadU16(const uint8_t* data, uint32_t size, uint32_t* offset, uint16_t* out) |
| 443 | { |
| 444 | if (*offset + 2 > size) |
| 445 | return false; |
| 446 | *out = (uint16_t) ((data[*offset] << 8) | data[*offset + 1]); |
| 447 | *offset += 2; |
| 448 | return true; |
| 449 | } |
| 450 | |
| 451 | static bool ReadU32(const uint8_t* data, uint32_t size, uint32_t* offset, uint32_t* out) |
| 452 | { |