🚨 Skip empty font info tables
A truncated font resource indexed an empty array on load.
This commit is contained in:
+2
-1
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user