fixed multiple returning when doing mt compressing/decompressing

This commit is contained in:
Tino Reichardt
2016-12-30 17:48:12 +01:00
parent 62ccbe9d58
commit f4f2729f08
6 changed files with 19 additions and 14 deletions

View File

@@ -485,6 +485,7 @@ size_t LZ4MT_decompressDCtx(LZ4MT_DCtx * ctx, LZ4MT_RdWr_t * rdwr)
int t, rv;
cwork_t *w = &ctx->cwork[0];
LZ4MT_Buffer *in = &w->in;
void *retval_of_thread = 0;
if (!ctx)
return ERROR(compressionParameter_unsupported);
@@ -544,7 +545,7 @@ size_t LZ4MT_decompressDCtx(LZ4MT_DCtx * ctx, LZ4MT_RdWr_t * rdwr)
void *p;
pthread_join(w->pthread, &p);
if (p)
return (size_t) p;
retval_of_thread = p;
}
okay:
@@ -559,7 +560,7 @@ size_t LZ4MT_decompressDCtx(LZ4MT_DCtx * ctx, LZ4MT_RdWr_t * rdwr)
free(wl);
}
return 0;
return (size_t)retval_of_thread;
}
/* returns current uncompressed data size */