[cairo-commit] 2 commits - src/cairo-arc.c
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sat Sep 23 11:10:18 UTC 2023
src/cairo-arc.c | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit 86d7025af513ac012961cfc6fdee99249342b8e7
Merge: ed86d953a 09643ee1a
Author: Emmanuele Bassi <ebassi at gmail.com>
Date: Sat Sep 23 11:10:16 2023 +0000
Merge branch 'wip-fix-352' into 'master'
Avoid assert when drawing arcs with NaN angles
Closes #352
See merge request cairo/cairo!515
commit 09643ee1abdd5daacebfcb564448f29be9a79bac
Author: Tim Serong <tserong at suse.com>
Date: Tue Sep 19 18:18:28 2023 +1000
Avoid assert when drawing arcs with NaN angles
I hit the problem with _cairo_arc_in_direction() failing the
angle_max >= angle_min assertion earlier this year when using
Thunderbird on openSUSE Tumbleweed. Thunderbird would crash
when rendering some (but not all) HTML email due to this
assert. For some reason, one of the angles passed in was
NaN. Making _cairo_arc_in_direction() return immediately if
either angle is not finite fixed the problem for me, but I
don't know enough about the internals of Cairo to know if
this is, strictly speaking, the "right" fix. Also, having
tested again today _without_ this change applied, I am now
no longer able to reproduce the problem :-/ I still have the
same version of Cairo installed (1.17.8), but various other
packages on that system have been updated in the meantime,
so maybe that's a factor. Or maybe I'm just lucky and
haven't hit a "bad" HTML email this time...?
Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/352
Signed-off-by: Tim Serong <tserong at suse.com>
diff --git a/src/cairo-arc.c b/src/cairo-arc.c
index 1c891d1a0..010b9c1a7 100644
--- a/src/cairo-arc.c
+++ b/src/cairo-arc.c
@@ -188,6 +188,9 @@ _cairo_arc_in_direction (cairo_t *cr,
if (cairo_status (cr))
return;
+ if (! ISFINITE (angle_max) || ! ISFINITE (angle_min))
+ return;
+
assert (angle_max >= angle_min);
if (angle_max - angle_min > 2 * M_PI * MAX_FULL_CIRCLES) {
More information about the cairo-commit
mailing list