diff --git a/ocaml/Block.ml b/ocaml/Block.ml index 3a7ad79..0d84642 100644 --- a/ocaml/Block.ml +++ b/ocaml/Block.ml @@ -110,7 +110,9 @@ let read_bytes b idx = Bytes.get_int64_ne b idx |> Int64.to_int in - Some (Bytes.sub b (idx+8) m, idx+8+m) + try + Some (Bytes.sub b (idx+8) m, idx+8+m) + with Invalid_argument _ -> None