[BASE] Saturate synthesized math baseline

Math baseline synthesis adds a full-range glyph bearing and half its
height. Saturate that final coordinate instead of relying on signed
position addition.

This is part of the complete position-overflow fix for issue #6151.

Testing: meson test -C build --print-errorlogs

Assisted-by: Codex <codex@openai.com>
This commit is contained in:
Behdad Esfahbod committed 2026-08-12 18:30:05 -06:00
1 parent 4281443dcd
commit 48cc5b17ca
1 file changed
+1 -1
+1 -1
View File
@@ -2389,7 +2389,7 @@ hb_ot_layout_get_baseline_with_fallback (hb_font_t *font,
hb_font_get_nominal_glyph (font, '-', &glyph)) &&
hb_font_get_glyph_extents (font, glyph, &extents))
{
*coord = extents.y_bearing + extents.height / 2;
*coord = hb_saturate_add (extents.y_bearing, extents.height / 2);
}
else
{