fixed invalid invocation of dictionary in legacy decoder v0.5
parent
197a55ee7b
commit
83d7bdee4b
|
@ -3063,7 +3063,7 @@ size_t ZSTDv05_decodeLiteralsBlock(ZSTDv05_DCtx* dctx,
|
||||||
|
|
||||||
size_t ZSTDv05_decodeSeqHeaders(int* nbSeq, const BYTE** dumpsPtr, size_t* dumpsLengthPtr,
|
size_t ZSTDv05_decodeSeqHeaders(int* nbSeq, const BYTE** dumpsPtr, size_t* dumpsLengthPtr,
|
||||||
FSEv05_DTable* DTableLL, FSEv05_DTable* DTableML, FSEv05_DTable* DTableOffb,
|
FSEv05_DTable* DTableLL, FSEv05_DTable* DTableML, FSEv05_DTable* DTableOffb,
|
||||||
const void* src, size_t srcSize)
|
const void* src, size_t srcSize, U32 flagStaticTable)
|
||||||
{
|
{
|
||||||
const BYTE* const istart = (const BYTE* const)src;
|
const BYTE* const istart = (const BYTE* const)src;
|
||||||
const BYTE* ip = istart;
|
const BYTE* ip = istart;
|
||||||
|
@ -3118,6 +3118,7 @@ size_t ZSTDv05_decodeSeqHeaders(int* nbSeq, const BYTE** dumpsPtr, size_t* dumps
|
||||||
FSEv05_buildDTable_raw(DTableLL, LLbits);
|
FSEv05_buildDTable_raw(DTableLL, LLbits);
|
||||||
break;
|
break;
|
||||||
case FSEv05_ENCODING_STATIC:
|
case FSEv05_ENCODING_STATIC:
|
||||||
|
if (!flagStaticTable) return ERROR(corruption_detected);
|
||||||
break;
|
break;
|
||||||
case FSEv05_ENCODING_DYNAMIC :
|
case FSEv05_ENCODING_DYNAMIC :
|
||||||
default : /* impossible */
|
default : /* impossible */
|
||||||
|
@ -3141,6 +3142,7 @@ size_t ZSTDv05_decodeSeqHeaders(int* nbSeq, const BYTE** dumpsPtr, size_t* dumps
|
||||||
FSEv05_buildDTable_raw(DTableOffb, Offbits);
|
FSEv05_buildDTable_raw(DTableOffb, Offbits);
|
||||||
break;
|
break;
|
||||||
case FSEv05_ENCODING_STATIC:
|
case FSEv05_ENCODING_STATIC:
|
||||||
|
if (!flagStaticTable) return ERROR(corruption_detected);
|
||||||
break;
|
break;
|
||||||
case FSEv05_ENCODING_DYNAMIC :
|
case FSEv05_ENCODING_DYNAMIC :
|
||||||
default : /* impossible */
|
default : /* impossible */
|
||||||
|
@ -3164,6 +3166,7 @@ size_t ZSTDv05_decodeSeqHeaders(int* nbSeq, const BYTE** dumpsPtr, size_t* dumps
|
||||||
FSEv05_buildDTable_raw(DTableML, MLbits);
|
FSEv05_buildDTable_raw(DTableML, MLbits);
|
||||||
break;
|
break;
|
||||||
case FSEv05_ENCODING_STATIC:
|
case FSEv05_ENCODING_STATIC:
|
||||||
|
if (!flagStaticTable) return ERROR(corruption_detected);
|
||||||
break;
|
break;
|
||||||
case FSEv05_ENCODING_DYNAMIC :
|
case FSEv05_ENCODING_DYNAMIC :
|
||||||
default : /* impossible */
|
default : /* impossible */
|
||||||
|
@ -3376,7 +3379,7 @@ static size_t ZSTDv05_decompressSequences(
|
||||||
/* Build Decoding Tables */
|
/* Build Decoding Tables */
|
||||||
errorCode = ZSTDv05_decodeSeqHeaders(&nbSeq, &dumps, &dumpsLength,
|
errorCode = ZSTDv05_decodeSeqHeaders(&nbSeq, &dumps, &dumpsLength,
|
||||||
DTableLL, DTableML, DTableOffb,
|
DTableLL, DTableML, DTableOffb,
|
||||||
ip, seqSize);
|
ip, seqSize, dctx->flagStaticTables);
|
||||||
if (ZSTDv05_isError(errorCode)) return errorCode;
|
if (ZSTDv05_isError(errorCode)) return errorCode;
|
||||||
ip += errorCode;
|
ip += errorCode;
|
||||||
|
|
||||||
|
@ -3385,6 +3388,7 @@ static size_t ZSTDv05_decompressSequences(
|
||||||
seq_t sequence;
|
seq_t sequence;
|
||||||
seqState_t seqState;
|
seqState_t seqState;
|
||||||
|
|
||||||
|
dctx->flagStaticTables = 1;
|
||||||
memset(&sequence, 0, sizeof(sequence));
|
memset(&sequence, 0, sizeof(sequence));
|
||||||
sequence.offset = REPCODE_STARTVALUE;
|
sequence.offset = REPCODE_STARTVALUE;
|
||||||
seqState.dumps = dumps;
|
seqState.dumps = dumps;
|
||||||
|
|
Loading…
Reference in New Issue