Files larger than 4 GB use co64 instead of stco, with 64-bit chunk offsets. Today you parse that variant, pinning the boundary where a 32-bit reader would silently fail.
Parse a co64 box into its list of 64-bit chunk offsets.
co64 is stco with wider offsets: each chunk offset is a 64-bit value instead
of 32-bit, used when the media data extends past the 4 GB that a 32-bit offset can
address. A file has one or the other, never both, and they mean exactly the same
thing - so the parser reads either into the same uint64 offset list. Here the
second offset 0x0000000100000000 is 4294967296, precisely 2^32.
That value is the point of the lesson: a parser that read co64 offsets with a
32-bit reader would truncate it to 0 and place the chunk at the start of the file.
Because you widened stco offsets to uint64 yesterday, both tables now produce
the identical shape, and the sample-location code you write next works regardless of
which one a file uses.
// identical to stco but each offset is a big-endian uint64func parseCo64(payload []byte) []uint64 {n := readU32(payload[4:8])// read n 64-bit offsets from offset 8, 8 bytes each}