Fix sentinel size miscalculation

Since is_nul() style wild-comparing stride is U64, we must add sizeof(U64) to the sentinel.
This commit is contained in:
Takayuki MATSUOKA 2015-02-12 21:26:32 +09:00
parent eed7952101
commit de5c930c90

View File

@ -667,7 +667,7 @@ static unsigned long long decodeLZ4S(FILE* finput, FILE* foutput)
inBuffSize = outBuffSize + 4;
inBuff = (char*)malloc(inBuffSize);
#if defined(LZ4IO_ENABLE_SPARSE_FILE)
outBuff = (char*)malloc(outBuffSize+1);
outBuff = (char*)malloc(outBuffSize+sizeof(U64));
outBuff[outBuffSize] = 1; /* sentinel */
#else /* LZ4IO_ENABLE_SPARSE_FILE */
outBuff = (char*)malloc(outBuffSize);