mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-20 06:21:16 +01:00
[gpu] Saturate clip-path extents
Clip paths add two full-range glyph-extents fields to find their far edge. Saturate those additions instead of narrowing an out-of-range 64-bit result back to int. Tested with: meson test -C build --print-errorlogs Assisted-by: OpenAI Codex
This commit is contained in:
1 parent
22554785a9
commit
3e4341ad20
1 file changed
+2
-2
+2
-2
@@ -176,9 +176,9 @@ hb_gpu_paint_push_clip_path_end (hb_paint_funcs_t *funcs HB_UNUSED,
|
||||
}
|
||||
|
||||
int x0 = ext.x_bearing;
|
||||
int x1 = (int) ((int64_t) ext.x_bearing + ext.width);
|
||||
int x1 = hb_saturate_add (ext.x_bearing, ext.width);
|
||||
int y0 = ext.y_bearing;
|
||||
int y1 = (int) ((int64_t) ext.y_bearing + ext.height);
|
||||
int y1 = hb_saturate_add (ext.y_bearing, ext.height);
|
||||
|
||||
c->clip_stack[c->clip_depth] = {
|
||||
HB_CODEPOINT_INVALID, nullptr,
|
||||
|
||||
Reference in new issue
Block a user