Fix IndexOutOfBoundsException raised by JZlibEncoder.encode()
- Fixes #1471
This commit is contained in:
parent
c7038ed8d6
commit
96c5ab62e6
@ -287,6 +287,7 @@ public class JZlibEncoder extends ZlibEncoder {
|
|||||||
|
|
||||||
// Configure output.
|
// Configure output.
|
||||||
int maxOutputLength = (int) Math.ceil(inputLength * 1.001) + 12;
|
int maxOutputLength = (int) Math.ceil(inputLength * 1.001) + 12;
|
||||||
|
out.ensureWritable(maxOutputLength);
|
||||||
z.avail_out = maxOutputLength;
|
z.avail_out = maxOutputLength;
|
||||||
z.next_out = out.array();
|
z.next_out = out.array();
|
||||||
z.next_out_index = out.arrayOffset() + out.writerIndex();
|
z.next_out_index = out.arrayOffset() + out.writerIndex();
|
||||||
|
Loading…
Reference in New Issue
Block a user