fix: ensure ecK is never greater than pos

This commit is contained in:
Eric 2024-06-14 13:05:44 +10:00
parent 215023bddc
commit 33eb176430
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -217,7 +217,7 @@ proc prepareDecodingData(
empty = blk.isEmpty
cids[idx] = blk.cid
if idx >= encoded.rounded:
if idx >= encoded.rounded and pos >= encoded.ecK:
trace "Retrieved parity block"
shallowCopy(parityData[pos - encoded.ecK], if blk.isEmpty: emptyBlock else: blk.data)
parityPieces.inc