summaryrefslogtreecommitdiffstats
path: root/gfx/cairo/max-font-size.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /gfx/cairo/max-font-size.patch
parentInitial commit. (diff)
downloadfirefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz
firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/cairo/max-font-size.patch')
-rw-r--r--gfx/cairo/max-font-size.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/gfx/cairo/max-font-size.patch b/gfx/cairo/max-font-size.patch
new file mode 100644
index 0000000000..efa54cef64
--- /dev/null
+++ b/gfx/cairo/max-font-size.patch
@@ -0,0 +1,28 @@
+diff --git a/gfx/cairo/cairo/src/cairo-ft-font.c b/gfx/cairo/cairo/src/cairo-ft-font.c
+--- a/gfx/cairo/cairo/src/cairo-ft-font.c
++++ b/gfx/cairo/cairo/src/cairo-ft-font.c
+@@ -63,6 +63,10 @@
+ /* This is the max number of FT_face objects we keep open at once
+ */
+ #define MAX_OPEN_FACES 10
++
++/* This is the maximum font size we allow to be passed to FT_Set_Char_Size
++ */
++#define MAX_FONT_SIZE 2000
+
+ /*
+ * The simple 2x2 matrix is converted into separate scale and shape
+@@ -682,9 +686,11 @@ _cairo_ft_unscaled_font_set_scale (cairo
+ FT_Set_Transform(unscaled->face, &mat, NULL);
+
+ if ((unscaled->face->face_flags & FT_FACE_FLAG_SCALABLE) != 0) {
++ double x_scale = MIN(sf.x_scale, MAX_FONT_SIZE);
++ double y_scale = MIN(sf.y_scale, MAX_FONT_SIZE);
+ error = FT_Set_Char_Size (unscaled->face,
+- sf.x_scale * 64.0 + .5,
+- sf.y_scale * 64.0 + .5,
++ x_scale * 64.0 + .5,
++ y_scale * 64.0 + .5,
+ 0, 0);
+ if (error)
+ return _cairo_error (CAIRO_STATUS_NO_MEMORY);