fix fuzzer32 litCSize limit condition
This commit is contained in:
@@ -120,8 +120,6 @@
|
|||||||
#define GB *(1U<<30)
|
#define GB *(1U<<30)
|
||||||
|
|
||||||
#define BLOCKSIZE (128 KB) /* define, for static allocation */
|
#define BLOCKSIZE (128 KB) /* define, for static allocation */
|
||||||
#define MIN_SEQUENCES_SIZE (2 /*seqNb*/ + 2 /*dumps*/ + 3 /*seqTables*/ + 1 /*bitStream*/)
|
|
||||||
#define MIN_CBLOCK_SIZE (3 /*litCSize*/ + MIN_SEQUENCES_SIZE)
|
|
||||||
#define IS_RAW BIT0
|
#define IS_RAW BIT0
|
||||||
#define IS_RLE BIT1
|
#define IS_RLE BIT1
|
||||||
|
|
||||||
|
|||||||
@@ -214,6 +214,10 @@ void ZSTD_resetSeqStore(seqStore_t* ssPtr);
|
|||||||
#define MaxLL ((1<<LLbits) - 1)
|
#define MaxLL ((1<<LLbits) - 1)
|
||||||
#define MaxOff 31
|
#define MaxOff 31
|
||||||
|
|
||||||
|
#define MIN_SEQUENCES_SIZE (2 /*seqNb*/ + 2 /*dumps*/ + 3 /*seqTables*/ + 1 /*bitStream*/)
|
||||||
|
#define MIN_CBLOCK_SIZE (3 /*litCSize*/ + MIN_SEQUENCES_SIZE)
|
||||||
|
|
||||||
|
|
||||||
/** ZSTD_storeSeq
|
/** ZSTD_storeSeq
|
||||||
Store a sequence (literal length, literals, offset code and match length) into seqStore_t
|
Store a sequence (literal length, literals, offset code and match length) into seqStore_t
|
||||||
@offsetCode : distance to match, or 0 == repCode
|
@offsetCode : distance to match, or 0 == repCode
|
||||||
|
|||||||
+1
-1
@@ -953,7 +953,7 @@ static size_t ZSTD_HC_compress_generic (ZSTD_HC_CCtx* ctxPtr,
|
|||||||
{
|
{
|
||||||
size_t cSize;
|
size_t cSize;
|
||||||
|
|
||||||
if (maxDstSize < 5) return ERROR(dstSize_tooSmall); /* not enough space to store compressed block */
|
if (maxDstSize < 3 + MIN_CBLOCK_SIZE) return ERROR(dstSize_tooSmall); /* not enough space to store compressed block */
|
||||||
|
|
||||||
if (remaining < blockSize) blockSize = remaining;
|
if (remaining < blockSize) blockSize = remaining;
|
||||||
cSize = blockCompressor(ctxPtr, op+3, maxDstSize-3, ip, blockSize);
|
cSize = blockCompressor(ctxPtr, op+3, maxDstSize-3, ip, blockSize);
|
||||||
|
|||||||
Reference in New Issue
Block a user