Title: [281439] trunk/Source/WebCore
Revision
281439
Author
[email protected]
Date
2021-08-23 00:11:41 -0700 (Mon, 23 Aug 2021)

Log Message

[Freetype] Set maximum allowed font size for Freetype
https://bugs.webkit.org/show_bug.cgi?id=228893

Reviewed by Michael Catanzaro.

Maximum allowed font size in Freetype2 is 65535 because x_ppem and y_ppem fields in FreeType structs are of type
'unsigned short'.

* rendering/style/RenderStyleConstants.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (281438 => 281439)


--- trunk/Source/WebCore/ChangeLog	2021-08-23 06:28:16 UTC (rev 281438)
+++ trunk/Source/WebCore/ChangeLog	2021-08-23 07:11:41 UTC (rev 281439)
@@ -1,3 +1,15 @@
+2021-08-22  Carlos Garcia Campos  <[email protected]>
+
+        [Freetype] Set maximum allowed font size for Freetype
+        https://bugs.webkit.org/show_bug.cgi?id=228893
+
+        Reviewed by Michael Catanzaro.
+
+        Maximum allowed font size in Freetype2 is 65535 because x_ppem and y_ppem fields in FreeType structs are of type
+        'unsigned short'.
+
+        * rendering/style/RenderStyleConstants.h:
+
 2021-08-22  Alan Bujtas  <[email protected]>
 
         [LFC][IFC] Add support for vertical-align: super

Modified: trunk/Source/WebCore/rendering/style/RenderStyleConstants.h (281438 => 281439)


--- trunk/Source/WebCore/rendering/style/RenderStyleConstants.h	2021-08-23 06:28:16 UTC (rev 281438)
+++ trunk/Source/WebCore/rendering/style/RenderStyleConstants.h	2021-08-23 07:11:41 UTC (rev 281439)
@@ -1108,8 +1108,13 @@
     Fit
 };
 
+#if USE(FREETYPE)
+// Maximum allowed font size in Freetype2 is 65535 because x_ppem and y_ppem fields in FreeType structs are of type 'unsigned short'.
+static const float maximumAllowedFontSize = std::numeric_limits<unsigned short>::max();
+#else
 // Reasonable maximum to prevent insane font sizes from causing crashes on some platforms (such as Windows).
 static const float maximumAllowedFontSize = 1000000.0f;
+#endif
 
 enum class TextIndentLine : uint8_t {
     FirstLine,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to