diff options
Diffstat (limited to 'ocaml/lib/bitstream.ml')
-rw-r--r-- | ocaml/lib/bitstream.ml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ocaml/lib/bitstream.ml b/ocaml/lib/bitstream.ml index cfe094c..8c1ef5b 100644 --- a/ocaml/lib/bitstream.ml +++ b/ocaml/lib/bitstream.ml @@ -15,7 +15,7 @@ type reader = { (** Create a new bitstream writer *) let writer_create () = { - buf = ref (Bytes.create 1024); + buf = ref (Bytes.make 1024 '\x00'); bit_pos = 0; } @@ -27,7 +27,7 @@ let writer_ensure (w : writer) (bits_needed : int) : unit = if bytes_needed > (Bytes.length current_buf) then begin let old_buf : bytes = current_buf in let new_size : int = max (bytes_needed * 2) (Bytes.length old_buf * 2) in - let new_buf : bytes = Bytes.create new_size in + let new_buf : bytes = Bytes.make new_size '\x00' in Bytes.blit old_buf 0 new_buf 0 (Bytes.length old_buf); buf_ref := new_buf end |