2
0
mirror of https://github.com/vasi/pixz synced 2024-10-30 15:21:41 +00:00

Fix an off-by-one error that causes memory corruption.

We read up to bsize bytes from gInFile, so allocate as much memory.
This commit is contained in:
Philipp Kern 2017-05-11 12:20:18 +02:00
parent 75f27d8850
commit 943932c0e8

View File

@ -538,7 +538,7 @@ static void read_thread(void) {
pipeline_item_t *pi;
queue_pop(gPipelineStartQ, (void**)&pi);
io_block_t *ib = (io_block_t*)(pi->data);
block_capacity(ib, iter.block.unpadded_size,
block_capacity(ib, bsize,
iter.block.uncompressed_size);
ib->insize = fread(ib->input, 1, bsize, gInFile);