fix real bug

This commit is contained in:
Matthew Kennedy 2022-07-20 15:26:06 -07:00
parent 3bac2b8b89
commit 4b277feea5
1 changed files with 1 additions and 1 deletions

View File

@ -14,7 +14,7 @@ void copyRange(uint8_t* destination, FragmentList src, size_t skip, size_t size)
size_t fragmentIndex = 0;
// Find which fragment to start - skip any full fragments smaller than `skip` parameter
while (skip > src.fragments[fragmentIndex].size && fragmentIndex <= src.count) {
while (fragmentIndex < src.count && skip > src.fragments[fragmentIndex].size) {
skip -= src.fragments[fragmentIndex].size;
fragmentIndex++;
}