Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
uint32_t plain_chunk_size;
uint32_t plain_chunk_offset;
uint32_t max_plain_size = 0x00008000;
- uint32_t max_comp_size = 0x00008000 + 2 + 12 /*TODO: what value do we really need here?*/;
+ /*
+ * The maximum compressed size of each MSZIP block is 32k + 12 bytes
+ * header size.
+ */
+ uint32_t max_comp_size = 0x00008000 + 12;
uint32_t tmp_offset;
int z_ret;
z->total_in = 0;
z->next_out = comp_chunk.data + 2;
- z->avail_out = comp_chunk.length - 2;
+ z->avail_out = comp_chunk.length;
z->total_out = 0;
if (!z->opaque) {