diff --git a/src/RNTuple/bootstrap.jl b/src/RNTuple/bootstrap.jl index b2130e88..9ea9f61c 100644 --- a/src/RNTuple/bootstrap.jl +++ b/src/RNTuple/bootstrap.jl @@ -16,6 +16,9 @@ end function ROOT_3a3a_Experimental_3a3a_RNTuple(io, tkey::TKey, refs) local_io = datastream(io, tkey) skip(local_io, 6) + _before_anchor = position(local_io) + anchor_checksum = xxh3_64(read(local_io, 2*4 + 6*8)) + seek(local_io, _before_anchor) anchor = ROOT_3a3a_Experimental_3a3a_RNTuple(; fVersionEpoch = readtype(local_io, UInt16), fVersionMajor = readtype(local_io, UInt16), @@ -30,6 +33,9 @@ function ROOT_3a3a_Experimental_3a3a_RNTuple(io, tkey::TKey, refs) fChecksum = readtype(local_io, UInt64), ) + @assert anchor.fChecksum == anchor_checksum "RNtuple anchor checksum doesn't match" + + header_bytes = decompress_bytes(read_seek_nb(io, anchor.fSeekHeader, anchor.fNBytesHeader), anchor.fLenHeader) header_io = IOBuffer(header_bytes) header = _rntuple_read(header_io, RNTupleEnvelope{RNTupleHeader})