fixed minor decompression bug in buffered mode

This commit is contained in:
Yann Collet 2015-11-25 21:09:17 +01:00
parent d3cb690156
commit e4fdad55dc
2 changed files with 13 additions and 9 deletions

View File

@ -439,11 +439,16 @@ size_t ZBUFF_decompressContinue(ZBUFF_DCtx* zbc, void* dst, size_t* maxDstSizePt
if (zbc->outBuff == NULL) return ERROR(memory_allocation);
}
}
memcpy(zbc->inBuff, zbc->headerBuffer, zbc->hPos);
zbc->inPos = zbc->hPos;
zbc->hPos = 0;
zbc->stage = ZBUFFds_load;
break; /* useless : stage follows */
if (zbc->hPos)
{
/* some data already loaded into headerBuffer : transfer into inBuff */
memcpy(zbc->inBuff, zbc->headerBuffer, zbc->hPos);
zbc->inPos = zbc->hPos;
zbc->hPos = 0;
zbc->stage = ZBUFFds_load;
break;
}
zbc->stage = ZBUFFds_read;
case ZBUFFds_read:
{

View File

@ -68,7 +68,6 @@
# include "zstd_legacy.h"
#endif
/* *******************************************************
* Compiler specifics
*********************************************************/