MIN(frame->header.windowSize,
(size_t)((BYTE*)srcPtr - (BYTE*)frame->srcStart))) +
1;
- if (info.useDict && (RAND(seed) & 1)) {
+ if (info.useDict && (RAND(seed) & 1) && i + 1 != numSequences) {
/* need to occasionally generate offsets that go past the start */
+ /* including i+1 != numSequences because the last sequences has to adhere to predetermined contentSize */
U32 lenPastStart = (RAND(seed) % info.dictContentSize) + 1;
offset = (U32)((BYTE*)srcPtr - (BYTE*)frame->srcStart)+lenPastStart;
if (offset > frame->header.windowSize) {