Fix bug in ConbinationStream when reading across boundaries

This commit is contained in:
Alex Barney 2018-10-12 16:51:09 -05:00
parent fb089b0700
commit e21c384a9c

View file

@ -83,7 +83,7 @@ namespace LibHac.Streams
break; break;
} }
int idx = 0; int idx = 0;
while (idx+1 < _streamsStartPos.Count) while (idx + 1 < _streamsStartPos.Count)
{ {
if (_streamsStartPos[idx + 1] > pos) if (_streamsStartPos[idx + 1] > pos)
{ {
@ -122,10 +122,11 @@ namespace LibHac.Streams
if (count > 0) if (count > 0)
{ {
if (_currentStreamIndex >= _streams.Count) if (_currentStreamIndex + 1 >= _streams.Count)
break; break;
_currentStream = _streams[_currentStreamIndex++]; _currentStream = _streams[_currentStreamIndex + 1];
_currentStreamIndex++;
_currentStream.Position = 0; _currentStream.Position = 0;
} }
} }