summaryrefslogtreecommitdiffstats
path: root/gfx/ots/src/colr.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
commita90a5cba08fdf6c0ceb95101c275108a152a3aed (patch)
tree532507288f3defd7f4dcf1af49698bcb76034855 /gfx/ots/src/colr.cc
parentAdding debian version 126.0.1-1. (diff)
downloadfirefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz
firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/ots/src/colr.cc')
-rw-r--r--gfx/ots/src/colr.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/gfx/ots/src/colr.cc b/gfx/ots/src/colr.cc
index 8931c77c32..a09d3ab3a4 100644
--- a/gfx/ots/src/colr.cc
+++ b/gfx/ots/src/colr.cc
@@ -193,7 +193,15 @@ bool ParsePaintColrLayers(const ots::Font* font,
colrState& state)
{
if (setContains(state.visited, data)) {
+#ifdef OTS_COLR_CYCLE_CHECK
+ // A cycle would imply an infinite loop during painting, unless the renderer
+ // detects and breaks it. To be safe, reject the table.
return OTS_FAILURE_MSG("Cycle detected in PaintColrLayers");
+#else
+ // Just issue a warning and return (as we've already checked this subgraph).
+ OTS_WARNING("Cycle detected in COLRv1 glyph paint graph (PaintColrLayers)\n");
+ return true;
+#endif
}
state.visited.insert(data);
@@ -393,7 +401,12 @@ bool ParsePaintColrGlyph(const ots::Font* font,
colrState& state)
{
if (setContains(state.visited, data)) {
+#ifdef OTS_COLR_CYCLE_CHECK
return OTS_FAILURE_MSG("Cycle detected in PaintColrGlyph");
+#else
+ OTS_WARNING("Cycle detected in COLRv1 glyph paint graph (PaintColrGlyph)\n");
+ return true;
+#endif
}
state.visited.insert(data);