Summary: | Server crashes when drawing filled arcs that open up or down with xlib | ||
---|---|---|---|
Product: | xorg | Reporter: | Knut Olav Bøhmer <bohmer> |
Component: | Server/General | Assignee: | Xorg Project Team <xorg-team> |
Status: | RESOLVED FIXED | QA Contact: | Xorg Project Team <xorg-team> |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Knut Olav Bøhmer
2015-04-08 14:44:05 UTC
It's a bug in miPolyFillArc. It is also hit by xts. This patch fixes it for me. http://marc.info/?l=freedesktop-xorg-devel&m=142850468414906&w=3 datura:~/git/xserver% git describe --contains 41932dfbc841a1adc6512d41085ea3f8ebecb42c xorg-server-1.17.99.901~152 datura:~/git/xserver% git show 41932dfbc841a1adc6512d41085ea3f8ebecb42c commit 41932dfbc841a1adc6512d41085ea3f8ebecb42c Author: Keith Packard <keithp@keithp.com> Date: Wed Apr 8 07:45:28 2015 -0700 mi: Partial pie-slice filled arcs may need more space for spans The mi filled arc code estimates that a filled arc will produce no more spans than the arc is tall. This is true for most arcs except for pie-slice arcs strictly between 180 and 360 degrees where the missing portion of the arc faces up or down such that we get two spans on some scanlines. For those, we need to reserve room for another height/2 spans. This patch just does it for all partial pie-sliced arcs to make the test easier to understand; it's just over-allocating a bit of memory, so that's safe. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com> diff --git a/mi/mifillarc.c b/mi/mifillarc.c index 246d70ff4c..888519edfa 100644 --- a/mi/mifillarc.c +++ b/mi/mifillarc.c @@ -660,6 +660,11 @@ miPolyFillArc(DrawablePtr pDraw, GCPtr pGC, int narcs_all, xArc * parcs) if (narcs && nspans + arc->height > MAX_SPANS_PER_LOOP) break; nspans += arc->height; + + /* A pie-slice arc may add another pile of spans */ + if (pGC->arcMode == ArcPieSlice && + (-FULLCIRCLE < arc->angle2 && arc->angle2 < FULLCIRCLE)) + nspans += (arc->height + 1) >> 1; } pts = points = malloc (sizeof (DDXPointRec) * nspans + |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.