diff --git a/MetadataExtractor/IO/SequentialStreamReader.cs b/MetadataExtractor/IO/SequentialStreamReader.cs index 4fdd1af8..fee9bb48 100644 --- a/MetadataExtractor/IO/SequentialStreamReader.cs +++ b/MetadataExtractor/IO/SequentialStreamReader.cs @@ -85,7 +85,7 @@ public override void Skip(long n) if (n < 0) throw new ArgumentException("n must be zero or greater."); - if (_stream.Position + n > _stream.Length) + if ((ulong)(_stream.Position + n) > (ulong)(_stream.Length)) throw new IOException($"Unable to skip. Requested {n} bytes but only {_stream.Length - _stream.Position} remained."); _stream.Seek(n, SeekOrigin.Current);