Lines Matching refs:litSize
73 …ateLiteralsBuffer(ZSTD_DCtx* dctx, void* const dst, const size_t dstCapacity, const size_t litSize, in ZSTD_allocateLiteralsBuffer() argument
76 …ot_streaming && dstCapacity > ZSTD_BLOCKSIZE_MAX + WILDCOPY_OVERLENGTH + litSize + WILDCOPY_OVERLE… in ZSTD_allocateLiteralsBuffer()
80 dctx->litBufferEnd = dctx->litBuffer + litSize; in ZSTD_allocateLiteralsBuffer()
83 else if (litSize > ZSTD_LITBUFFEREXTRASIZE) in ZSTD_allocateLiteralsBuffer()
88 …dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OV… in ZSTD_allocateLiteralsBuffer()
89 dctx->litBufferEnd = dctx->litBuffer + litSize - ZSTD_LITBUFFEREXTRASIZE; in ZSTD_allocateLiteralsBuffer()
93 dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize; in ZSTD_allocateLiteralsBuffer()
102 dctx->litBufferEnd = dctx->litBuffer + litSize; in ZSTD_allocateLiteralsBuffer()
138 { size_t lhSize, litSize, litCSize; in ZSTD_decodeLiteralsBlock() local
150 litSize = (lhc >> 4) & 0x3FF; in ZSTD_decodeLiteralsBlock()
156 litSize = (lhc >> 4) & 0x3FFF; in ZSTD_decodeLiteralsBlock()
162 litSize = (lhc >> 4) & 0x3FFFF; in ZSTD_decodeLiteralsBlock()
166 RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled"); in ZSTD_decodeLiteralsBlock()
167 RETURN_ERROR_IF(litSize > ZSTD_BLOCKSIZE_MAX, corruption_detected, ""); in ZSTD_decodeLiteralsBlock()
169 RETURN_ERROR_IF(expectedWriteSize < litSize , dstSize_tooSmall, ""); in ZSTD_decodeLiteralsBlock()
170 … ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 0); in ZSTD_decodeLiteralsBlock()
173 if (dctx->ddictIsCold && (litSize > 768 /* heuristic */)) { in ZSTD_decodeLiteralsBlock()
180 dctx->litBuffer, litSize, istart+lhSize, litCSize, in ZSTD_decodeLiteralsBlock()
184 dctx->litBuffer, litSize, istart+lhSize, litCSize, in ZSTD_decodeLiteralsBlock()
191 dctx->entropy.hufTable, dctx->litBuffer, litSize, in ZSTD_decodeLiteralsBlock()
196 dctx->entropy.hufTable, dctx->litBuffer, litSize, in ZSTD_decodeLiteralsBlock()
202 dctx->entropy.hufTable, dctx->litBuffer, litSize, in ZSTD_decodeLiteralsBlock()
210 …Buffer + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH, dctx->litBuffer, litSize - ZSTD_LITBUFFERE… in ZSTD_decodeLiteralsBlock()
218 dctx->litSize = litSize; in ZSTD_decodeLiteralsBlock()
225 { size_t litSize, lhSize; in ZSTD_decodeLiteralsBlock() local
232 litSize = istart[0] >> 3; in ZSTD_decodeLiteralsBlock()
236 litSize = MEM_readLE16(istart) >> 4; in ZSTD_decodeLiteralsBlock()
240 litSize = MEM_readLE24(istart) >> 4; in ZSTD_decodeLiteralsBlock()
244 RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled"); in ZSTD_decodeLiteralsBlock()
245 RETURN_ERROR_IF(expectedWriteSize < litSize, dstSize_tooSmall, ""); in ZSTD_decodeLiteralsBlock()
246 … ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 1); in ZSTD_decodeLiteralsBlock()
247 …if (lhSize+litSize+WILDCOPY_OVERLENGTH > srcSize) { /* risk reading beyond src buffer with wildco… in ZSTD_decodeLiteralsBlock()
248 RETURN_ERROR_IF(litSize+lhSize > srcSize, corruption_detected, ""); in ZSTD_decodeLiteralsBlock()
251 … ZSTD_memcpy(dctx->litBuffer, istart + lhSize, litSize - ZSTD_LITBUFFEREXTRASIZE); in ZSTD_decodeLiteralsBlock()
252 …ZSTD_memcpy(dctx->litExtraBuffer, istart + lhSize + litSize - ZSTD_LITBUFFEREXTRASIZE, ZSTD_LITBUF… in ZSTD_decodeLiteralsBlock()
256 ZSTD_memcpy(dctx->litBuffer, istart + lhSize, litSize); in ZSTD_decodeLiteralsBlock()
259 dctx->litSize = litSize; in ZSTD_decodeLiteralsBlock()
260 return lhSize+litSize; in ZSTD_decodeLiteralsBlock()
264 dctx->litSize = litSize; in ZSTD_decodeLiteralsBlock()
265 dctx->litBufferEnd = dctx->litPtr + litSize; in ZSTD_decodeLiteralsBlock()
267 return lhSize+litSize; in ZSTD_decodeLiteralsBlock()
272 size_t litSize, lhSize; in ZSTD_decodeLiteralsBlock() local
278 litSize = istart[0] >> 3; in ZSTD_decodeLiteralsBlock()
282 litSize = MEM_readLE16(istart) >> 4; in ZSTD_decodeLiteralsBlock()
286 litSize = MEM_readLE24(istart) >> 4; in ZSTD_decodeLiteralsBlock()
290 RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled"); in ZSTD_decodeLiteralsBlock()
291 RETURN_ERROR_IF(litSize > ZSTD_BLOCKSIZE_MAX, corruption_detected, ""); in ZSTD_decodeLiteralsBlock()
292 RETURN_ERROR_IF(expectedWriteSize < litSize, dstSize_tooSmall, ""); in ZSTD_decodeLiteralsBlock()
293 … ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 1); in ZSTD_decodeLiteralsBlock()
296 ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize - ZSTD_LITBUFFEREXTRASIZE); in ZSTD_decodeLiteralsBlock()
301 ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize); in ZSTD_decodeLiteralsBlock()
304 dctx->litSize = litSize; in ZSTD_decodeLiteralsBlock()
1551 const BYTE* const litEnd = litPtr + dctx->litSize;