🚨 Skip empty font info tables

A truncated font resource indexed an empty array on load.
This commit is contained in:
2026-11-15 22:06:51 +01:00
parent c6e1a10d3b
commit ee0667aff3
+2 -1
View File
@@ -185,7 +185,8 @@ 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));
AFontInfo.Read(FFontInfo[0], Length(FFontInfo) * SizeOf(TFontInfo)); if Length(FFontInfo) > 0 then
AFontInfo.Read(FFontInfo[0], Length(FFontInfo) * SizeOf(TFontInfo));
end; end;
procedure TGLFont.UpdateTexture; procedure TGLFont.UpdateTexture;