🚨 Skip empty font info tables
A truncated font resource indexed an empty array on load.
This commit is contained in:
@@ -185,6 +185,7 @@ begin
|
|||||||
AFontInfo.Read(FSpaceWidth, SizeOf(FSpaceWidth));
|
AFontInfo.Read(FSpaceWidth, SizeOf(FSpaceWidth));
|
||||||
SetLength(FFontInfo, (AFontInfo.Size - AFontInfo.Position) div
|
SetLength(FFontInfo, (AFontInfo.Size - AFontInfo.Position) div
|
||||||
SizeOf(TFontInfo));
|
SizeOf(TFontInfo));
|
||||||
|
if Length(FFontInfo) > 0 then
|
||||||
AFontInfo.Read(FFontInfo[0], Length(FFontInfo) * SizeOf(TFontInfo));
|
AFontInfo.Read(FFontInfo[0], Length(FFontInfo) * SizeOf(TFontInfo));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user