diff --git a/components/fpspreadsheet/xlsbiff8.pas b/components/fpspreadsheet/xlsbiff8.pas index 6ff20ef26..f56079f9f 100755 --- a/components/fpspreadsheet/xlsbiff8.pas +++ b/components/fpspreadsheet/xlsbiff8.pas @@ -1271,6 +1271,9 @@ begin while (not BIFF8EOF) do begin + //Safe to not read beyond assigned worksheet names. + if FCurrentWorksheet>FWorksheetNames.Count-1 then break; + ReadWorksheet(AStream, AData); // Check for the end of the file