fixed continuation context
This commit is contained in:
@@ -1399,7 +1399,7 @@ size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t di
|
||||
{
|
||||
zds->stage = zdss_loadHeader;
|
||||
zds->lhSize = zds->inPos = zds->outStart = zds->outEnd = 0;
|
||||
if ((dict != zds->dictSource) || (dictSize != zds->dictSize)) { /* new dictionary */
|
||||
if ((dict != zds->dictSource) | (dictSize != zds->dictSize)) { /* new dictionary */
|
||||
if (dictSize > zds->dictSize) {
|
||||
if (zds->dictContent) zds->customMem.customFree(zds->customMem.opaque, zds->dictContent);
|
||||
zds->dictContent = zds->customMem.customAlloc(zds->customMem.opaque, dictSize);
|
||||
@@ -1457,7 +1457,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB
|
||||
|
||||
#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)
|
||||
if (zds->legacyVersion)
|
||||
return ZSTD_decompressLegacyStream(&zds->legacyContext, zds->legacyVersion, output, input);
|
||||
return ZSTD_decompressLegacyStream(zds->legacyContext, zds->legacyVersion, output, input);
|
||||
#endif
|
||||
|
||||
while (someMoreWork) {
|
||||
|
||||
@@ -4643,9 +4643,9 @@ size_t ZBUFFv07_decompressContinue(ZBUFFv07_DCtx* zbd,
|
||||
|
||||
case ZBUFFds_loadHeader :
|
||||
{ size_t const hSize = ZSTDv07_getFrameParams(&(zbd->fParams), zbd->headerBuffer, zbd->lhSize);
|
||||
if (ZSTDv07_isError(hSize)) return hSize;
|
||||
if (hSize != 0) {
|
||||
size_t const toLoad = hSize - zbd->lhSize; /* if hSize!=0, hSize > zbd->lhSize */
|
||||
if (ZSTDv07_isError(hSize)) return hSize;
|
||||
if (toLoad > (size_t)(iend-ip)) { /* not enough input to load full header */
|
||||
memcpy(zbd->headerBuffer + zbd->lhSize, ip, iend-ip);
|
||||
zbd->lhSize += iend-ip;
|
||||
@@ -4685,6 +4685,7 @@ size_t ZBUFFv07_decompressContinue(ZBUFFv07_DCtx* zbd,
|
||||
if (zbd->outBuff == NULL) return ERROR(memory_allocation);
|
||||
} } }
|
||||
zbd->stage = ZBUFFds_read;
|
||||
/* pass-through */
|
||||
|
||||
case ZBUFFds_read:
|
||||
{ size_t const neededInSize = ZSTDv07_nextSrcSizeToDecompress(zbd->zd);
|
||||
|
||||
Reference in New Issue
Block a user