diff --git a/sources/OpenMcdf/CompoundFile.cs b/sources/OpenMcdf/CompoundFile.cs index 556ea88e..d0654175 100644 --- a/sources/OpenMcdf/CompoundFile.cs +++ b/sources/OpenMcdf/CompoundFile.cs @@ -1507,8 +1507,13 @@ StreamView miniFATView result.Add(ms); miniFATView.Seek(nextSecID * 4, SeekOrigin.Begin); - nextSecID = miniFATReader.ReadInt32(); - } + int next = miniFATReader.ReadInt32(); + + if (next != nextSecID) + nextSecID = next; + else + throw new CFCorruptedFileException("Cyclic sector chain found. File is corrupted"); + } } return result; }