Skip to content

Commit 99ec814

Browse files
committed
Minor fixes to view stream read
1 parent ea1f027 commit 99ec814

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

SabreTools.IO/Streams/ViewStream.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,10 @@ public override int Read(byte[] buffer, int offset, int count)
201201
// Invalid cases always return 0
202202
if (buffer.Length == 0)
203203
return 0;
204-
if (offset < 0 || offset > buffer.Length)
204+
if (offset < 0 || offset >= buffer.Length)
205205
return 0;
206206
if (count < 0 || offset + count > buffer.Length)
207207
return 0;
208-
if (!SegmentValid(Position, count))
209-
return 0;
210208

211209
// Short-circuit 0-byte reads
212210
if (count == 0)

0 commit comments

Comments
 (0)