You've already forked lazarus-ccr
fpspreadsheet: Fix Excel8 reader crashing if file does not contain a FONT record (reported by Malcolm Buckingham on mailing list, Oct 30 2017)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6047 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1263,6 +1263,14 @@ function TsSpreadBIFFReader.FixFontIndex(AFontIndex: Integer): Integer;
|
||||
var
|
||||
fnt: TsFont;
|
||||
begin
|
||||
// There are some files which do not contain any font records.
|
||||
// Here we use the predefined DefaultFont of the workbook.
|
||||
if FFontList.Count = 0 then
|
||||
begin
|
||||
Result := 0;
|
||||
exit;
|
||||
end;
|
||||
|
||||
fnt := TsFont(FFontList[AFontIndex]);
|
||||
if fnt = nil then // damned font 4!
|
||||
Result := -1
|
||||
|
Reference in New Issue
Block a user