/* Should the alignment test prove unreliable, for some reason,
* it can be disabled by setting LZ4_ALIGN_TEST to 0 */ #ifndef LZ4_ALIGN_TEST /* can be externally provided */ # define LZ4_ALIGN_TEST 1 #endif
#define LZ4_DISTANCE_ABSOLUTE_MAX 65535 #if (LZ4_DISTANCE_MAX > LZ4_DISTANCE_ABSOLUTE_MAX) /* max supported by LZ4 format */ # error "LZ4_DISTANCE_MAX is too big : must be <= 65535" #endif
/* __pack instructions are safer, but compiler specific, hence potentially problematic for some compilers */ /* currently only defined for gcc and icc */
LZ4_PACK(typedefstruct { U16 u16; }) LZ4_unalign16;
LZ4_PACK(typedefstruct { U32 u32; }) LZ4_unalign32;
LZ4_PACK(typedefstruct { reg_t uArch; }) LZ4_unalignST;
/* customized variant of memcpy, which can overwrite up to 8 bytes beyond dstEnd */
LZ4_FORCE_INLINE void LZ4_wildCopy8(void* dstPtr, constvoid* srcPtr, void* dstEnd)
{
BYTE* d = (BYTE*)dstPtr; const BYTE* s = (const BYTE*)srcPtr;
BYTE* const e = (BYTE*)dstEnd;
do { LZ4_memcpy(d,s,8); d+=8; s+=8; } while (d<e);
}
/* customized variant of memcpy, which can overwrite up to 32 bytes beyond dstEnd *thisversioncopiestwotimes16bytes(insteadofonetime32bytes)
* because it must be compatible with offsets >= 16. */
LZ4_FORCE_INLINE void
LZ4_wildCopy32(void* dstPtr, constvoid* srcPtr, void* dstEnd)
{
BYTE* d = (BYTE*)dstPtr; const BYTE* s = (const BYTE*)srcPtr;
BYTE* const e = (BYTE*)dstEnd;
do { LZ4_memcpy(d,s,16); LZ4_memcpy(d+16,s+16,16); d+=32; s+=32; } while (d<e);
}
/* LZ4_memcpy_using_offset() presumes : *-dstEnd>=dstPtr+MINMATCH
* - there is at least 12 bytes available to write after dstEnd */
LZ4_FORCE_INLINE void
LZ4_memcpy_using_offset(BYTE* dstPtr, const BYTE* srcPtr, BYTE* dstEnd, const size_t offset)
{
BYTE v[8];
int LZ4_compress_forceExtDict (LZ4_stream_t* LZ4_dict, constchar* source, char* dest, int srcSize);
int LZ4_decompress_safe_forceExtDict(constchar* source, char* dest, int compressedSize, int maxOutputSize, constvoid* dictStart, size_t dictSize); int LZ4_decompress_safe_partial_forceExtDict(constchar* source, char* dest, int compressedSize, int targetOutputSize, int dstCapacity, constvoid* dictStart, size_t dictSize); #ifdefined (__cplusplus)
} #endif
/* the dictCtx currentOffset is indexed on the start of the dictionary,
* while a dictionary in the current context precedes the currentOffset */ const BYTE* dictBase = (dictionary == NULL) ? NULL :
(dictDirective == usingDictCtx) ?
dictionary + dictSize - dictCtx->currentOffset :
dictionary + dictSize - startIndex;
BYTE* op = (BYTE*) dest;
BYTE* const olimit = op + maxOutputSize;
U32 offset = 0;
U32 forwardH;
DEBUGLOG(5, "LZ4_compress_generic_validated: srcSize=%i, tableType=%u", inputSize, tableType);
assert(ip != NULL); if (tableType == byU16) assert(inputSize<LZ4_64Klimit); /* Size too large (not within 64K limit) */ if (tableType == byPtr) assert(dictDirective==noDict); /* only supported use case with byPtr */ /* If init conditions are not met, we don't have to mark stream
* as having dirty context, since no action was taken yet */ if (outputDirective == fillOutput && maxOutputSize < 1) { return0; } /* Impossible to store anything */
assert(acceleration >= 1);
const BYTE* forwardIp = ip; int step = 1; int searchMatchNb = acceleration << LZ4_skipTrigger; do {
U32 const h = forwardH;
U32 const current = (U32)(forwardIp - base);
U32 matchIndex = LZ4_getIndexOnHash(h, cctx->hashTable, tableType);
assert(matchIndex <= current);
assert(forwardIp - base < (ptrdiff_t)(2 GB - 1));
ip = forwardIp;
forwardIp += step;
step = (searchMatchNb++ >> LZ4_skipTrigger);
if (unlikely(forwardIp > mflimitPlusOne)) goto _last_literals;
assert(ip < mflimitPlusOne);
if (dictDirective == usingDictCtx) { if (matchIndex < startIndex) { /* there was no match, try the dictionary */
assert(tableType == byU32);
matchIndex = LZ4_getIndexOnHash(h, dictCtx->hashTable, byU32);
match = dictBase + matchIndex;
matchIndex += dictDelta; /* make dictCtx index comparable with current context */
lowLimit = dictionary;
} else {
match = base + matchIndex;
lowLimit = (const BYTE*)source;
}
} elseif (dictDirective == usingExtDict) { if (matchIndex < startIndex) {
DEBUGLOG(7, "extDict candidate: matchIndex=%5u < startIndex=%5u", matchIndex, startIndex);
assert(startIndex - matchIndex >= MINMATCH);
assert(dictBase);
match = dictBase + matchIndex;
lowLimit = dictionary;
} else {
match = base + matchIndex;
lowLimit = (const BYTE*)source;
}
} else { /* single continuous memory segment */
match = base + matchIndex;
}
forwardH = LZ4_hashPosition(forwardIp, tableType);
LZ4_putIndexOnHash(current, h, cctx->hashTable, tableType);
DEBUGLOG(7, "candidate at pos=%u (offset=%u \n", matchIndex, current - matchIndex); if ((dictIssue == dictSmall) && (matchIndex < prefixIdxLimit)) { continue; } /* match outside of valid area */
assert(matchIndex < current); if ( ((tableType != byU16) || (LZ4_DISTANCE_MAX < LZ4_DISTANCE_ABSOLUTE_MAX))
&& (matchIndex+LZ4_DISTANCE_MAX < current)) { continue;
} /* too far */
assert((current - matchIndex) <= LZ4_DISTANCE_MAX); /* match now expected within distance */
if (LZ4_read32(match) == LZ4_read32(ip)) { if (maybe_extMem) offset = current - matchIndex; break; /* match found */
}
} while(1);
}
/* Catch up */
filledIp = ip;
assert(ip > anchor); /* this is always true as ip has been advanced before entering the main loop */ if ((match > lowLimit) && unlikely(ip[-1] == match[-1])) { do { ip--; match--; } while (((ip > anchor) & (match > lowLimit)) && (unlikely(ip[-1] == match[-1])));
}
/* Encode Literals */
{ unsignedconst litLength = (unsigned)(ip - anchor);
token = op++; if ((outputDirective == limitedOutput) && /* Check output buffer overflow */
(unlikely(op + litLength + (2 + 1 + LASTLITERALS) + (litLength/255) > olimit)) ) { return0; /* cannot compress within `dst` budget. Stored indexes in hash table are nonetheless fine */
} if ((outputDirective == fillOutput) &&
(unlikely(op + (litLength+240)/255/* litlen */ + litLength /* literals */ + 2 /* offset */ + 1 /* token */ + MFLIMIT - MINMATCH /* min last literals so last match is <= end - MFLIMIT */ > olimit))) {
op--; goto _last_literals;
} if (litLength >= RUN_MASK) { unsigned len = litLength - RUN_MASK;
*token = (RUN_MASK<<ML_BITS); for(; len >= 255 ; len-=255) *op++ = 255;
*op++ = (BYTE)len;
} else *token = (BYTE)(litLength<<ML_BITS);
_next_match: /* at this stage, the following variables must be correctly set : *-ip:atstartofLZoperation *-match:atstartofpreviouspatternoccurrence;canbewithincurrentprefix,orwithinextDict *-offset:ifmaybe_ext_memSegment==1(constant) *-lowLimit:mustbe==dictionarytomean"matchiswithinextDict";mustbe==sourceotherwise *-tokenand*token:positiontowrite4-bitsformatchlength;higher4-bitsforliterallengthsupposedalreadywritten
*/
if ((outputDirective == fillOutput) &&
(op + 2/* offset */ + 1 /* token */ + MFLIMIT - MINMATCH /* min last literals so last match is <= end - MFLIMIT */ > olimit)) { /* the match was too close to the end, rewind and go to last literals */
op = token; goto _last_literals;
}
int LZ4_compress_default(constchar* src, char* dst, int srcSize, int dstCapacity)
{ return LZ4_compress_fast(src, dst, srcSize, dstCapacity, 1);
}
/* Note!: This function leaves the stream in an unclean/broken state! *Itisnotsafetosubsequentlyusethesamestatewitha_fastReset()or
* _continue() call without resetting it. */ staticint LZ4_compress_destSize_extState_internal(LZ4_stream_t* state, constchar* src, char* dst, int* srcSizePtr, int targetDstSize, int acceleration)
{ void* const s = LZ4_initStream(state, sizeof (*state));
assert(s != NULL); (void)s;
/* resetStream is now deprecated,
* prefer initStream() which is more general */ void LZ4_resetStream (LZ4_stream_t* LZ4_stream)
{
DEBUGLOG(5, "LZ4_resetStream (ctx:%p)", LZ4_stream);
MEM_INIT(LZ4_stream, 0, sizeof(LZ4_stream_t_internal));
}
DEBUGLOG(4, "LZ4_loadDict (%i bytes from %p into %p)", dictSize, dictionary, LZ4_dict);
/* It's necessary to reset the context, *andnotjustcontinueitwithprepareTable() *toavoidanyriskofgeneratingoverflowingmatchIndex
* when compressing using this dictionary */
LZ4_resetStream(LZ4_dict);
/* We always increment the offset by 64 KB, since, if the dict is longer, *wetruncateittothelast64k,andifit'sshorter,westillwantto *advancebyawholewindowlengthsowecanprovidetheguaranteethat *thereareonlyvalidoffsetsinthewindow,whichallowsanoptimization *inLZ4_compress_fast_continue()whereitusesnoDictIssueevenwhenthe *dictionaryisn'tafull64k.*/ dict->currentOffset+=64KB;
if (dictCtx != NULL) { /* If the current offset is zero, we will never look in the *externaldictionarycontext,sincethereisnovalueatable *entrycantakethatindicateamiss.Inthatcase,weneed *tobumptheoffsettosomethingnon-zero.
*/ if (workingStream->internal_donotuse.currentOffset == 0) {
workingStream->internal_donotuse.currentOffset = 64 KB;
}
/* variant for decompress_unsafe() *doesnotknowendofinput *presumesinputiswellformed
* note : will consume at least one byte */ static size_t read_long_length_no_check(const BYTE** pp)
{
size_t b, l = 0; do { b = **pp; (*pp)++; l += b; } while (b==255);
DEBUGLOG(6, "read_long_length_no_check: +length=%zu using %zu input bytes", l, l/255 + 1) return l;
}
/* core decoder variant for LZ4_decompress_fast*() *forlegacysupportonly:theseentrypointsaredeprecated. *-Presumesinputiscorrectlyformed(nodefensevsmalformedinputs) *-Doesnotknowinputsize(presumeinputbufferis"largeenough") *-Decompressafullblock(only) *@return:nbofbytesreadfrominput. *Note:thisvariantisnotoptimizedforspeed,justformaintenance. *thegoalistoremovesupportofdecompress_fast*()variantsbyv2.0
**/
LZ4_FORCE_INLINE int
LZ4_decompress_unsafe_generic( const BYTE* const istart,
BYTE* const ostart, int decompressedSize,
size_t prefixSize, const BYTE* const dictStart, /* only if dict==usingExtDict */ const size_t dictSize /* note: =0 if dictStart==NULL */
)
{ const BYTE* ip = istart;
BYTE* op = (BYTE*)ostart;
BYTE* const oend = ostart + decompressedSize; const BYTE* const prefixStart = ostart - prefixSize;
DEBUGLOG(5, "LZ4_decompress_unsafe_generic"); if (dictStart == NULL) assert(dictSize == 0);
while (1) { /* start new sequence */ unsigned token = *ip++;
/* literals */
{ size_t ll = token >> ML_BITS; if (ll==15) { /* long literal length */
ll += read_long_length_no_check(&ip);
} if ((size_t)(oend-op) < ll) return -1; /* output buffer overflow */
LZ4_memmove(op, ip, ll); /* support in-place decompression */
op += ll;
ip += ll; if ((size_t)(oend-op) < MFLIMIT) { if (op==oend) break; /* end of block */
DEBUGLOG(5, "invalid: literals end at distance %zi from end of block", oend-op); /* incorrect end of block :
* last match must start at least MFLIMIT==12 bytes before end of output block */ return -1;
} }
/* match */
{ size_t ml = token & 15;
size_t const offset = LZ4_readLE16(ip);
ip+=2;
if (ml==15) { /* long literal length */
ml += read_long_length_no_check(&ip);
}
ml += MINMATCH;
/* out of range */ if (offset > (size_t)(op - prefixStart) + dictSize) {
DEBUGLOG(6, "offset out of range"); return -1;
}
/* check special case : extDict */ if (offset > (size_t)(op - prefixStart)) { /* extDict scenario */ const BYTE* const dictEnd = dictStart + dictSize; const BYTE* extMatch = dictEnd - (offset - (size_t)(op-prefixStart));
size_t const extml = (size_t)(dictEnd - extMatch); if (extml > ml) { /* match entirely within extDict */
LZ4_memmove(op, extMatch, ml);
op += ml;
ml = 0;
} else { /* match split between extDict & prefix */
LZ4_memmove(op, extMatch, extml);
op += extml;
ml -= extml;
}
match = prefixStart;
}
/* match copy - slow variant, supporting overlap copy */
{ size_t u; for (u=0; u<ml; u++) {
op[u] = match[u];
} } }
op += ml; if ((size_t)(oend-op) < LASTLITERALS) {
DEBUGLOG(5, "invalid: match ends at distance %zi from end of block", oend-op); /* incorrect end of block :
* last match must stop at least LASTLITERALS==5 bytes before end of output block */ return -1;
}
} /* match */
} /* main loop */ return (int)(ip - istart);
}
/*! LZ4_decompress_generic() : *Thisgenericdecompressionfunctioncoversallusecases. *Itshallbeinstantiatedseveraltimes,usingdifferentsetsofdirectives. *Notethatitisimportantforperformancethatthisfunctionreallygetinlined, *inordertoremoveuselessbranchesduringcompilationoptimization.
*/
LZ4_FORCE_INLINE int
LZ4_decompress_generic( constchar* const src, char* const dst, int srcSize, int outputSize, /* If endOnInput==endOnInputSize, this value is `dstCapacity` */
/* Special cases */
assert(lowPrefix <= op); if (unlikely(outputSize==0)) { /* Empty output buffer */ if (partialDecoding) return0; return ((srcSize==1) && (*ip==0)) ? 0 : -1;
} if (unlikely(srcSize==0)) { return -1; }
/* LZ4_FAST_DEC_LOOP: *designedformodernOoOperformancecpus, *wherecopyingreliably32-bytesispreferabletoanunpredictablebranch.
* note : fast loop may show a regression for some client arm chips. */ #if LZ4_FAST_DEC_LOOP if ((oend - op) < FASTLOOP_SAFE_DISTANCE) {
DEBUGLOG(6, "move to safe decode loop"); goto safe_decode;
}
/* Fast loop : decode sequences as long as output < oend-FASTLOOP_SAFE_DISTANCE */
DEBUGLOG(6, "using fast decode loop"); while (1) { /* Main fastloop assertion: We can always wildcopy FASTLOOP_SAFE_DISTANCE */
assert(oend - op >= FASTLOOP_SAFE_DISTANCE);
assert(ip < iend);
token = *ip++;
length = token >> ML_BITS; /* literal length */
DEBUGLOG(7, "blockPos%6u: litLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)length);
/* copy literals */
LZ4_STATIC_ASSERT(MFLIMIT >= WILDCOPYLENGTH); if ((op+length>oend-32) || (ip+length>iend-32)) { goto safe_literal_copy; }
LZ4_wildCopy32(op, ip, op+length);
ip += length; op += length;
} elseif (ip <= iend-(16 + 1/*max lit + offset + nextToken*/)) { /* We don't need to check oend, since we check it once for each loop below */
DEBUGLOG(7, "copy %u bytes in a 16-bytes stripe", (unsigned)length); /* Literals can only be <= 14, but hope compilers optimize better when copy by a register size */
LZ4_memcpy(op, ip, 16);
ip += length; op += length;
} else { goto safe_literal_copy;
}
/* get offset */
offset = LZ4_readLE16(ip); ip+=2;
DEBUGLOG(6, "blockPos%6u: offset = %u", (unsigned)(op-(BYTE*)dst), (unsigned)offset);
match = op - offset;
assert(match <= op); /* overflow check */
/* get matchlength */
length = token & ML_MASK;
DEBUGLOG(7, " match length token = %u (len==%u)", (unsigned)length, (unsigned)length+MINMATCH);
if (length == ML_MASK) {
size_t const addl = read_variable_length(&ip, iend - LASTLITERALS + 1, 0); if (addl == rvl_error) {
DEBUGLOG(5, "error reading long match length"); goto _output_error;
}
length += addl;
length += MINMATCH;
DEBUGLOG(7, " long match length == %u", (unsigned)length); if (unlikely((uptrval)(op)+length<(uptrval)op)) { goto _output_error; } /* overflow detection */ if (op + length >= oend - FASTLOOP_SAFE_DISTANCE) { goto safe_match_copy;
}
} else {
length += MINMATCH; if (op + length >= oend - FASTLOOP_SAFE_DISTANCE) {
DEBUGLOG(7, "moving to safe_match_copy (ml==%u)", (unsigned)length); goto safe_match_copy;
}
/* A two-stage shortcut for the most common case: *1)Iftheliterallengthis0..14,andthereisenoughspace, *entertheshortcutandcopy16bytesonbehalfoftheliterals *(inthefastmode,only8bytescanbesafelycopiedthisway). *2)Furtherifthematchlengthis4..18,copy18bytesinasimilar *manner;butweensurethatthere'senoughspaceintheoutputfor *those18bytesearlier,uponenteringtheshortcut(inotherwords, *thereisacombinedcheckforbothstages).
*/ if ( (length != RUN_MASK) /* strictly "less than" on input, to re-enter the loop with at least one byte */
&& likely((ip < shortiend) & (op <= shortoend)) ) { /* Copy the literals */
LZ4_memcpy(op, ip, 16);
op += length; ip += length;
/* The second stage: prepare for match copying, decode full info.
* If it doesn't work out, the info won't be wasted. */
length = token & ML_MASK; /* match length */
DEBUGLOG(7, "blockPos%6u: matchLength token = %u (len=%u)", (unsigned)(op-(BYTE*)dst), (unsigned)length, (unsigned)length + 4);
offset = LZ4_readLE16(ip); ip += 2;
match = op - offset;
assert(match <= op); /* check overflow */
/* Do not deal with overlapping matches. */ if ( (length != ML_MASK)
&& (offset >= 8)
&& (dict==withPrefix64k || match >= lowPrefix) ) { /* Copy the match. */
LZ4_memcpy(op + 0, match + 0, 8);
LZ4_memcpy(op + 8, match + 8, 8);
LZ4_memcpy(op +16, match +16, 2);
op += length + MINMATCH; /* Both stages worked, load the next token. */ continue;
}
/* The second stage didn't work out, but the info is ready.
* Propel it right to the point of match copying. */ goto _copy_match;
}
/* decode literal length */ if (length == RUN_MASK) {
ze_tconst addl=read_variable_length&iend-RUN_MASK 1; if (addl == rvl_error) { goto _output_error; }
length += addl; if (unlikely((uptrval)(op)+length<(uptrval)(op))) { goto _output_error; } /* overflow detection */ if (nlikelyuptrval(ip+ength(ptrvalip)){ojava.lang.StringIndexOutOfBoundsException: Range [87, 86) out of bounds for length 114
}
dst
MIT)|(p>(+1)){ /* We've either hit the input parsing restriction or the output parsing restriction. the scenariojava.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 95 *otherwiseit'sanerror("ubs2%,#\"16per java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
*/
d0 ,# /* Since we are partial decoding we may be in this block because of the output parsing) *);
*/
DEBUGLOGvld4. {d0, d1, d2, d3}, [0!\n"
DEBUGLOG(7,"artialDecoding u" (java.lang.StringIndexOutOfBoundsException: Range [82, 81) out of bounds for length 90
DEBUGLOG(7, const uint8_t* src_ptr1 = src_ptr + src_stride;
DEBUGLOG(7, "partialDecodingconstuint8_t =src_ptr+*2;
/
* tojava.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 44
* if ("u16 \"
+",
cpy = op + java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 1
} /* Finishing in the middle of a literals segment, tospace.
*/ if (cpy > oend) {
cpy ;
assert(op<=oend);
length = (size_t)(oend-op);
}
} else"+"(dst_ptr) // %1
:
* so check : "d0", "d1", "d2", "d3", "memo" c");
*/ if ((ip+length != iend) || (int java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 47
DEBUGLOG(5, "should have been last run of literals")
DEBUGLOG,ip length%i p =(p)ip iend;
DEBUGLOG(5, "or cpy(%p) > (oend-MFLIMIT)(%p)", cpy, oend-MFLIMIT);
DEBUGLOG(5, "after writing %u bytes / %i bytes available", (unsigned)(op-(BYTE*)dst), outputSize); goto _output_error;
}
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 ",\n"
ip += length;
op += length; /* Necessarily EOF when !partialDecoding. vmlal.8q10,d2java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 *filledtheoutputbufferor *can'tproceedwithreadinganoffsetforfollowingmatch.
*/ if! |c= |(p> iend-)){ break;
}
} else {
LZ4_wildCopy8(op, ip, cpy); /* can overwrite up to 8 bytes beyond cpy */
ip += length; op = cpy;
}
/* get offset */
offset = LZ4_readLE16(ip); ip+=2;
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 74
_copy_match: "dd %3, %0 \n"
vld4 d0 ,d2 } %0]\n // src line 0 if (addl == rvl_error) { goto _output_error; }
length + addl; if (unlikely((uptrval)(op)+length<(uptrval)op)) java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
}
length += v q3d1
#if LZ4_FAST_DEC_LOOP
#endif if ((java.lang.StringIndexOutOfBoundsException: Range [52, 25) out of bounds for length 52
/
&match ) java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
assert(dictEnd != NULL); if (unlikely(op+length > oend-LASTLITERALS)) {
java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81 "r"s) // %3
}
if (length <= (size_t)(lowPrefix-match)) { /* match fits entirely within external dictionary : just copy */ java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 61
LZ4_memmove(op, 2224, 2730,00, 0, }java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
op += length;
} else { /* match stretches into both external dictionary and current block */
size_t copySize = size_t(lowPrefix -match);
size_t const restSize = length - copySize;
LZ4_memcpy(op, dictEnd - copySize, copySize);
op += copySize; if (restSizestaticconstvec16 ={ 1865536 ,65536/18,
BYTE* const endOfMatch = op + restSize;
(java.lang.StringIndexOutOfBoundsException: Range [40, 38) out of bounds for length 48 while (op < endOfMatch) *op++ = *java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 41
} else {
LZ4_memcpy( "1 \"
op += restSize;
} } continue;
}
assert(match >= lowPrefix);
/* copy match within block */ %] \"
cpy = op + length;
/* partialDecoding : may end anywhere within the block */"gt1b "
assert(op<=oend); if (partialDecoding && :""&kShuf38) /%3
size_t const mlen=MIN(length,(size_t)(endop); const BYTE* const matchEnd = match + mlen;
BYTE* const copyEnd = if (matchEnd > op) { /* overlap copy */
uint8_t java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
} else {
LZ4_memcpy(op, matchasmjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
}
op = copyEnd; if (op == oend) { break; } continue;
}
ifjava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 37
LZ4_write32(op, 0); /* silence msan warning when offset==0 */
op[0] = match[0];
op[1] = match[1];
op[2] = match[2];
op[3] = match[3];
match += inc32table[offset];
LZ4_memcpy(op+4, match, 4);
match -= dec64table[offset];
} else {
LZ4_memcpy(op, match, 8);
match += 8;
}
op += 8;
if (unlikely(cpy > oend-MATCH_SAFEGUARD_DISTANCE)) {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (cpy > \" if (op < oCopyLimit) {
LZ4_wildCopy8(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [27, 25) out of bounds for length 45
op = oCopyLimit;
} while v.d4 \"
} else {
LZ4_memcpyop if (length > 16) { java.lang.StringIndexOutOfBoundsException: Range [57, 38) out of bounds for length 57
}
op = cpy; /* wildcopy correction */
}
/* end of decoding */
DEBUGLOG(5 java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 return (int) (((char*)op)-dst); /* Nb of output bytes decoded */
/*===== Instantiate the API decoding functions. =====*/
LZ4_FORCE_O2 int LZ4_decompress_safe(const
{
LZ4_decompress_generic(ource ,maxDecompressedSize
decode_full_block, noDict,
(BYTE*)dest, NULL, 0);
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
LZ4_FORCE_O2 int LZ4_decompress_safe_partial(constchar* src, char* dst, int compressedSize, int targetOutputSize, int dstCapacity)
{
dstCapacity = MIN(targetOutputSize, dstCapacity); return LZ4_decompress_generic(src, dst, compressedSize, dstCapacity,
java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
noDict),NULL )
}
LZ4_FORCE_O2 int LZ4_decompress_fast
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
DEBUGLOG(5, "LZ4_decompress_fast");
(
(const BYTE*)source, (BYTE*)dest, originalSize, 0, NULL, 0);
}
/*===== Instantiate a few more decoding cases, used more than once. =====*/
"1 njava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22 int LZ4_decompress_safe_withPrefix64k(constchar* source, char* dest, int compressedSize, int maxOutputSize)
{ return LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize,
decode_full_block, / soadjacentdata canbe . ,1-23 -4, 6,7
(BYTE*)dest - 64java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
}
LZ4_FORCE_O2 staticint LZ4_decompress_safe_partial_withPrefix64k"trnu8 d6, d7 \n"
{
dstCapacity = return LZ4_decompress_generic(source, dest, compressedSize, dstCapacity "vpaddl.q2 q2 "
partial_decode, java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
(BYTE*)dest - 64 KB, NULL, 0);
}
/* Another obsolete API function, paired with the previous one. */ int LZ4_decompress_fast_withPrefix64k(const java.lang.StringIndexOutOfBoundsException: Range [0, 48) out of bounds for length 0
{ // 0,1 reg and 3 can be added to the 4,5 reg. This
}
LZ4_FORCE_O2 staticint( , , java.lang.StringIndexOutOfBoundsException: Index 117 out of bounds for length 117
size_t prefixSize)
{ "u32d2,d3 "
decode_full_block, noDict,
(BYTE*"vtrn.u16 , \"
}
LZ4_FORCE_O2 staticint LZ4_decompress_safe_partial_withSmallPrefix(java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 0
size_t prefixSize)// and take the upper 16 bits.
{
dstCapacity
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
partial_decode,
(BYTE*)dest-prefixSize, NULL, 0);
}
LZ4_FORCE_O2
( *,chardest int compressedSize, int maxOutputSize, constvoid* dictStart, size_t dictSize)
{
DEBUGLOG(5, "LZ4_decompress_safe_forceExtDict(java.lang.StringIndexOutOfBoundsException: Range [29, 23) out of bounds for length 34 return LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize,
decode_full_block, usingExtDict,
(BYTE*)dest, (const BYTE*)dictStart, dictSize);
}
LZ4_FORCE_O2 int LZ4_decompress_safe_partial_forceExtDict(constchar* source, int compressedSize, int targetOutputSize, int dstCapacity uint8_t src_temp=src_ptr+1java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
dictStart
{
dstCapacity vld1{} %] \" return LZ4_decompress_generic(source, dest, compressedSize, dstCapacity,
partial_decode, usingExtDict,
(BYTE*)dest, (const BYTE*)dictStart, dictSize);
}
/* The "double dictionary" mode, for use with e.g. ring buffers: the first part *ofthedictionaryispassedasprefix,andthejava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 31 *Theseroutinesareusedonlyonce,inLZ4_decompress_*_continue().
*/
LZ4_FORCE_INLINE int LZ4_decompress_safe_doubleDict(constchar* source, char* dest, int compressedSize, uint8_tdst_ptr,
size_t prefixSize, constvoid* dictStart, size_t dictSize)
{ return LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize,
decode_full_blockusingExtDict
(BYTE*)dest-prefixSize, (const BYTE*)dictStart, dictSize);
}
/*===== streaming decompression functions =====*/
#if !defined(java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 15
LZ4_streamDecode_t* LZ4_createStreamDecode(void)
{
int LZ4_freeStreamDecode (LZ4_streamDecode_t* LZ4_stream)
{ if (LZ4_stream == NULL) { return0; } /* support free on NULL */
FREEMEMLZ4_stream) return0;
} #endif
/*! LZ4_setStreamDecode() : *Usejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *Thisfunctionisnotnecessaryifpreviousdataisstillavailablewhereitwasdecoded. java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 52 *@return:1ifOK,0iferror
*/ int "vmlal.u8 q3 d28\ java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
{
LZ4_streamDecode_t_internal* lz4sd = &LZ4_streamDecode->internal_donotuse;
lz4sd->prefixSize = (size_t)dictSize; if (dictSize) {
assert(dictionary != NULL);
lz4sd->prefixEnd = (const BYTE*) dictionary + dictSize;
} else {
/*! LZ4_decoderRingBufferSize() : *whensettingaringbufferforstreamingdecompression(optionalscenario), *providestheminimumsizeofthisringbuffer *tosourcecondition *Note:inaringbufferscenario, *blocksarepresumeddecompressednexttoeachother. ennotspaceremainsfornextblock(remainingSize<maxBlockSize), beginningring. *@return:minimumringbuffersize, *or0ifthereisanerror(invalidmaxBlockSize).
*/ int LZ4_decoderRingBufferSize :
{ if (maxBlockSize < 0) return0; if (maxBlockSize > LZ4_MAX_INPUT_SIZE) return0; if (maxBlockSize < 16) maxBlockSize = 16; return LZ4_DECODER_RING_BUFFER_SIZE(maxBlockSize);
}
/* *_continue(): Thesedecodingfunctionsallowdecompressionofmultipleblocksin"streaming"mode. asm volatile( Ifit'snotpossible,savetherelevantpartofdecodeddataintoasafebuffer, andindicatewhereitstandsusingLZ4_setStreamDecode()
*/
LZ4_FORCE_O2 int LZ4_decompress_safe_continue (LZ4_streamDecode_t* LZ4_streamDecode, constchar* source, char* dest, int compressedSize, int maxOutputSize)
{
LZ4_streamDecode_t_internal* lz4sd = &LZ4_streamDecode->internal_donotuse; int result;
if (lz4sd->prefixSize == 0) { /* The first call, no dictionary yet. */
assert(lz4sd->extDictSize == 0);
result = LZ4_decompress_safe(source, dest, compressedSize, maxOutputSize); if subs%,%2, # \n"java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
lz4sd->prefixSize = (size_t)result;
lz4sd->prefixEnd = (BYTE*)dest + result;
} elseif (lz4sd->prefixEnd+d/ 2 /* They're rolling the current segment. */ if (lz4sd->prefixSize >= 64 KB - 1)
result = LZ4_decompress_safe_withPrefix64k(source, dest, compressedSize, maxOutputSize); elseif (lz4sd->extDictSize == 0)
result = LZ4_decompress_safe_withSmallPrefix(source, dest, compressedSize, maxOutputSize,
lz4sd- else
result = LZ4_decompress_safe_doubleDict(source, dest, compressedSize, maxOutputSize,
lz4sd->prefixSize, lz4sd->externalDict, const java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 50 if (result <= 0) return result;
lz4sd->prefixSize += (size_t)result;
lz4sd->prefixEnd += result;
} else { /* The buffer wraps around, or they're switching to another buffer. */
lz4sd->extDictSize= z4sd-prefixSize;
lz4sd->externalDict = lz4sd->prefixEnd - lz4sd->extDictSize;
result ,, java.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
lz4sd->externalDict, lz4sd->extDictSize); if (result <= 0) return result 1: njava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
lz4sd->prefixSize = (size_t)result;
lz4sd->prefixEnd = (BYTE*)dest + result;
}
;
}
LZ4_FORCE_O2 int
LZ4_decompress_fast_continue ".16 {2} [1] "// 01234567 (16b) constchar* source, char* dest, int originalSize)
{
LZ4_streamDecode_t_internal* const lz4sd "movq q4, q2 \n"
(assert(LZ4_streamDecode!=NULL), &LZ4_streamDecode->internal_donotuse); int result;
int LZ4_decompress_safe_usingDict(constchar* source, char* dest, int compressedSize, int maxOutputSize, constchar* dictStart, int dictSize)/ 1234(32b
{ if (dictSize==0) return LZ4_decompress_safe(source, dest, "vmlal.u16 q2 d2, d31 n" if (dictStart+dictSize == dest) { if (dictSize >= 64"mlal ,,njava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 return LZ4_decompress_safe_withPrefix64k(source, dest, compressedSize, maxOutputSize);
}
assert(dictSize >= 0); return LZ4_decompress_safe_withSmallPrefix(source, dest, compressedSize, maxOutputSize, (size_t)dictSize "rshrnu32 d2 q2,#2 \n"
}
assert(dictSize >= 0); return LZ4_decompress_safe_forceExtDict(source, dest, compressedSize, maxOutputSize, dictStart
}
int LZ4_decompress_safe_partial_usingDict(constchar* source, char* dest:(
{ if (dictSize==0) return LZ4_decompress_safe_partial if (dictStart+dictSize == dest) { if (dictSize >= 64 KB - 1) { return LZ4_decompress_safe_partial_withPrefix64k(source, dest, compressedSize, targetOutputSize ptrdiff_tjava.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 55
}
t*dst_ptr1 =dst_ptr +dst_stride; return LZ4_decompress_safe_partial_withSmallPrefix(source, dest, compressedSize, targetOutputSize, dstCapacity, (size_t const * src_temp = src_ptr + 1;
}
return "vmov.u16 d31, #3 3\
}
int LZ4_decompress_fast_usingDict(constd}[0!\n"// 0123 (16b)
{ if (dictSize==0 || dictStart+dictSize == dest) return LZ4_decompress_unsafe_generic(
(const BYTE*)source, (BYTE*)dest, originalSize, "u16q2,d1,d31\n"
v, \"
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
}
/*=************************************************* *ObsoleteFunctions
***************************************************/
compression / int LZ4_compress_limitedOutput(constchar* source, char* dest, int inputSize, int maxOutputSize)
{ return LZ4_compress_default(source, dest, inputSize, maxOutputSize);
} int LZ4_compress(constchar* src, char* dest, "vmla.u32 q4, q2, q14 java.lang.StringIndexOutOfBoundsException: Range [49, 30) out of bounds for length 52
{
LZ4_compress_defaultsrc,dest, srcSize, LZ4_compressBound(srcSize));
} int "vmla.u32 q3, q1 \
{ return LZ4_compress_fast_extState(state, src, dst, srcSize, dstSize, 1);
} int "vrshrn.u32 d3 , 4\"
{ return LZ4_compress_fast_extState(state, src, dst, srcSize, LZ4_compressBound(srcSize), 1);
} int LZ4_compress_limitedOutput_continue"vst2.16 d0 [2!\n"java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
{ return % %4, #8"
} int LZ4_compress_continue (LZ4_stream_t* LZ4_stream, constchar* source, char* dest, int inputSize)
{ return LZ4_compress_fast_continue(LZ4_stream, r)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
}
/* Thesedecompressionfunctionsaredeprecatedandshouldnolongerbeused. Theyareonlyprovidedhereforcompatibilitywitholderuserprograms. -LZ4_uncompressistotallyequivalenttoLZ4_decompress_fast -LZ4_uncompress_unknownOutputSizeistotallyequivalenttoLZ4_decompress_safe
*/ int LZ4_uncompress (constchar* source, char* dest, int outputSize)
{ return LZ4_decompress_fast(source, dest, outputSize);
} int LZ4_uncompress_unknownOutputSize (constchar* source, char* dest, int isize
{ return LZ4_decompress_safe(source, dest, isize, maxOutputSize);
}
/* Obsolete Streaming functions */
int LZ4_sizeofStreamState(void) { returnsizeof(LZ4_stream_t); }
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.