Skip to content

Commit

Permalink
AA : Add check condition for end of stream
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeugma440 committed Oct 1, 2024
1 parent 2c5cb60 commit a6450e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ATL/AudioData/IO/AA.cs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ private void readChapters(BufferedBinaryReader source, long offset, long size)
if (null == tagData.Chapters) tagData.Chapters = new List<ChapterInfo>(); else tagData.Chapters.Clear();
double cumulatedDuration = 0;
int idx = 1;
while (source.Position < offset + size)
while (source.Position < offset + size && source.Position < source.Length)
{
uint chapterSize = StreamUtils.DecodeBEUInt32(source.ReadBytes(4));
uint chapterOffset = StreamUtils.DecodeBEUInt32(source.ReadBytes(4));
Expand Down

0 comments on commit a6450e9

Please sign in to comment.