Skip to content

Commit edf5f2c

Browse files
authored
Test fix
1 parent caca4a4 commit edf5f2c

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

SabreTools.Serialization/Readers/ISO9660.cs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -650,10 +650,7 @@ public static List<PathTableGroup> ParsePathTableGroup(Stream data, short sector
650650

651651
// Validate extent length
652652
if (extentLength <= 0 || extentFinal > (long)data.Length)
653-
{
654-
Console.WriteLine($"ERROR0: {extentLength} <= 0 || {extentFinal} > {(long)data.Length}");
655653
return null;
656-
}
657654

658655
// Move stream to directory location
659656
data.SeekIfPossible(extentOffset, SeekOrigin.Begin);
@@ -668,10 +665,7 @@ public static List<PathTableGroup> ParsePathTableGroup(Stream data, short sector
668665
// Start of directory should not be 0
669666
int firstRecordLength = data.PeekByteValue();
670667
if (firstRecordLength == 0)
671-
{
672-
Console.WriteLine($"ERROR1: {firstRecordLength} != 0");
673668
return null;
674-
}
675669

676670
// Read all directory records in this directory
677671
var records = new List<DirectoryRecord>();
@@ -694,9 +688,9 @@ public static List<PathTableGroup> ParsePathTableGroup(Stream data, short sector
694688

695689
// Start of sector should not be 0, ignore entire directory
696690
int nextRecordLength = data.PeekByteValue();
697-
if (nextRecordLength <= paddingLength)
691+
if (nextRecordLength <= 0)
698692
{
699-
Console.WriteLine($"ERROR2: {nextRecordLength} <= {paddingLength}");
693+
Console.WriteLine($"Debug: {nextRecordLength} <= {paddingLength}");
700694
return null;
701695
}
702696

@@ -715,10 +709,7 @@ public static List<PathTableGroup> ParsePathTableGroup(Stream data, short sector
715709
// Compare recordLength with number of bytes in directoryRecord and return null if mismatch
716710
var readLength = 33 + directoryRecord.FileIdentifier.Length + (directoryRecord.PaddingField == null ? 0 : 1) + directoryRecord.SystemUse.Length;
717711
if (readLength != recordLength)
718-
{
719-
Console.WriteLine($"ERROR3: {readLength} != {recordLength}");
720712
return null;
721-
}
722713

723714
records.Add(directoryRecord);
724715
}

0 commit comments

Comments
 (0)