init_output_bitstream(): Set bytes_remaining correctly
authorEric Biggers <ebiggers3@gmail.com>
Fri, 20 Dec 2013 23:06:31 +0000 (17:06 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Fri, 20 Dec 2013 23:06:31 +0000 (17:06 -0600)
src/compress.c

index c121511..7d5e2b6 100644 (file)
@@ -122,7 +122,7 @@ init_output_bitstream(struct output_bitstream *ostream,
        ostream->bit_output          = data;
        ostream->next_bit_output     = data + 2;
        ostream->output              = data + 4;
-       ostream->bytes_remaining     = num_bytes;
+       ostream->bytes_remaining     = num_bytes - 4;
        ostream->overrun             = false;
 }