mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-09-22 23:05:12 +00:00
Fix other data endpoint issues
This commit is contained in:
@@ -48,9 +48,9 @@ namespace SabreTools.Serialization.Streams
|
||||
break;
|
||||
|
||||
// Align to the 4-byte boundary if we're not at the end
|
||||
if (data.Position != data.Length)
|
||||
if (data.Position < data.Length)
|
||||
{
|
||||
while ((data.Position % 4) != 0)
|
||||
while (data.Position < data.Length && (data.Position % 4) != 0)
|
||||
_ = data.ReadByteValue();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -716,7 +716,7 @@ namespace SabreTools.Serialization.Streams
|
||||
{
|
||||
var attributeCertificateTable = new List<AttributeCertificateTableEntry>();
|
||||
|
||||
while (data.Position < endOffset && data.Position != data.Length)
|
||||
while (data.Position < endOffset && data.Position < data.Length)
|
||||
{
|
||||
var entry = new AttributeCertificateTableEntry();
|
||||
|
||||
@@ -731,7 +731,7 @@ namespace SabreTools.Serialization.Streams
|
||||
attributeCertificateTable.Add(entry);
|
||||
|
||||
// Align to the 8-byte boundary
|
||||
while ((data.Position % 8) != 0 && data.Position < endOffset && data.Position != data.Length)
|
||||
while ((data.Position % 8) != 0 && data.Position < endOffset && data.Position < data.Length)
|
||||
_ = data.ReadByteValue();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user