fixing error when file size is multiple of job size (in which case, the srcSize of the last job is 0)

This commit is contained in:
Paul Cruz
2017-07-19 14:54:15 -07:00
parent 42382c1216
commit 6767abe652
+2 -2
View File
@@ -450,7 +450,7 @@ static void* compressionThread(void* arg)
/* reset compressed size */
job->compressedSize = 0;
while (remaining != 0) {
do {
size_t const actualBlockSize = MIN(remaining, compressionBlockSize);
DEBUG(2, "remaining: %zu\n", remaining);
DEBUG(2, "actualBlockSize: %zu\n", actualBlockSize);
@@ -505,7 +505,7 @@ static void* compressionThread(void* arg)
}
pthread_mutex_unlock(&ctx->completion_mutex.pMutex);
}
}
} while (remaining != 0);
job->dst.size = job->compressedSize;
}
pthread_mutex_lock(&ctx->jobCompressed_mutex.pMutex);