Skip to content

Commit 4151d4f

Browse files
authored
Merge pull request #427 from KirkLandTrip/main
SequentialStreamReader.cs: Cast numbers to ulong before bound check
2 parents ed79cc0 + 69f9d11 commit 4151d4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

MetadataExtractor/IO/SequentialStreamReader.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public override void Skip(long n)
8585
if (n < 0)
8686
throw new ArgumentException("n must be zero or greater.");
8787

88-
if (_stream.Position + n > _stream.Length)
88+
if ((ulong)(_stream.Position + n) > (ulong)(_stream.Length))
8989
throw new IOException($"Unable to skip. Requested {n} bytes but only {_stream.Length - _stream.Position} remained.");
9090

9191
_stream.Seek(n, SeekOrigin.Current);

0 commit comments

Comments
 (0)