Skip to content

Commit

Permalink
Fix #124: Integer overflow in SelectionHelper.DecodeStream
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollo3zehn committed Jul 23, 2024
1 parent ddb83dc commit 2dc760f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/PureHDF/Selections/SelectionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ private static void EncodeStream<TResult>(
lastTargetChunkIndex = targetStep.ChunkIndex;
}

var currentOffset = (int)targetStep.Offset;
var currentOffset = (long)targetStep.Offset;
var currentLength = (int)targetStep.Length;

while (currentLength > 0)
Expand Down Expand Up @@ -316,7 +316,7 @@ private static void DecodeStream<TResult>(
}

var virtualDatasetStream = sourceStream as VirtualDatasetStream<TResult>;
var currentOffset = (int)sourceStep.Offset;
var currentOffset = (long)sourceStep.Offset;
var currentLength = (int)sourceStep.Length;

while (currentLength > 0)
Expand Down

0 comments on commit 2dc760f

Please sign in to comment.