@@ -126,12 +126,9 @@ CompressedOutputStream::CompressedOutputStream(OutputStream& os,
126126 // Allocate first buffer and add padding for incompressible blocks
127127 const int bufSize = max (_blockSize + (_blockSize >> 3 ), DEFAULT_BUFFER_SIZE);
128128 _buffers[0 ] = new SliceArray<byte>(new byte[bufSize], bufSize, 0 );
129- _buffers[_jobs] = new SliceArray<byte>(nullptr , 0 , 0 );
130129
131- for (int i = 1 ; i < _jobs; i++) {
130+ for (int i = 1 ; i < 2 * _jobs; i++)
132131 _buffers[i] = new SliceArray<byte>(nullptr , 0 , 0 );
133- _buffers[i + _jobs] = new SliceArray<byte>(nullptr , 0 , 0 );
134- }
135132}
136133
137134CompressedOutputStream::CompressedOutputStream (OutputStream& os, Context& ctx, bool headerless)
@@ -210,12 +207,9 @@ CompressedOutputStream::CompressedOutputStream(OutputStream& os, Context& ctx, b
210207 // Allocate first buffer and add padding for incompressible blocks
211208 const int bufSize = max (_blockSize + (_blockSize >> 3 ), DEFAULT_BUFFER_SIZE);
212209 _buffers[0 ] = new SliceArray<byte>(new byte[bufSize], bufSize, 0 );
213- _buffers[_jobs] = new SliceArray<byte>(nullptr , 0 , 0 );
214210
215- for (int i = 1 ; i < _jobs; i++) {
211+ for (int i = 1 ; i < 2 * _jobs; i++)
216212 _buffers[i] = new SliceArray<byte>(nullptr , 0 , 0 );
217- _buffers[i + _jobs] = new SliceArray<byte>(nullptr , 0 , 0 );
218- }
219213}
220214
221215CompressedOutputStream::~CompressedOutputStream ()
0 commit comments