fixed offset in this case os that it always goes past src start

This commit is contained in:
Paul Cruz 2017-06-21 18:47:40 -07:00
parent 0950b3159a
commit 04094f37e9

View File

@ -683,8 +683,8 @@ static U32 generateSequences(U32* seed, frame_t* frame, seqStore_t* seqStore,
1;
if (info.useDict && (RAND(seed) & 1)) {
/* need to occasionally generate offsets that go past the start */
U32 const lenPastStart = RAND(seed) % info.dictContentSize;
offset = offset+lenPastStart;
U32 const lenPastStart = RAND(seed) % info.dictContentSize + 1;
offset = ((BYTE*)srcPtr - (BYTE*)frame->srcStart)+lenPastStart;
}
offsetCode = offset + ZSTD_REP_MOVE;
repIndex = 2;