mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 14:00:03 +01:00
exa: only draw valid trapezoids
Fixes freedesktop.org bug https://bugs.freedesktop.org/show_bug.cgi?id=67484
If t->bottom is close to MIN_INT, removing top can wraparound, so do the check properly.
A similar fix should also be applied to pixman.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit c6511d0142)
This commit is contained in:
parent
62bf33d0d1
commit
db258a27f0
2 changed files with 3 additions and 2 deletions
|
|
@ -1141,7 +1141,8 @@ exaTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
|
||||||
|
|
||||||
exaPrepareAccess(pPicture->pDrawable, EXA_PREPARE_DEST);
|
exaPrepareAccess(pPicture->pDrawable, EXA_PREPARE_DEST);
|
||||||
for (; ntrap; ntrap--, traps++)
|
for (; ntrap; ntrap--, traps++)
|
||||||
(*ps->RasterizeTrapezoid) (pPicture, traps, -bounds.x1, -bounds.y1);
|
if (xTrapezoidValid(traps))
|
||||||
|
(*ps->RasterizeTrapezoid) (pPicture, traps, -bounds.x1, -bounds.y1);
|
||||||
exaFinishAccess(pPicture->pDrawable, EXA_PREPARE_DEST);
|
exaFinishAccess(pPicture->pDrawable, EXA_PREPARE_DEST);
|
||||||
|
|
||||||
xRel = bounds.x1 + xSrc - xDst;
|
xRel = bounds.x1 + xSrc - xDst;
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,7 @@ typedef pixman_fixed_t xFixed;
|
||||||
/* whether 't' is a well defined not obviously empty trapezoid */
|
/* whether 't' is a well defined not obviously empty trapezoid */
|
||||||
#define xTrapezoidValid(t) ((t)->left.p1.y != (t)->left.p2.y && \
|
#define xTrapezoidValid(t) ((t)->left.p1.y != (t)->left.p2.y && \
|
||||||
(t)->right.p1.y != (t)->right.p2.y && \
|
(t)->right.p1.y != (t)->right.p2.y && \
|
||||||
(int) ((t)->bottom - (t)->top) > 0)
|
((t)->bottom > (t)->top))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Standard NTSC luminance conversions:
|
* Standard NTSC luminance conversions:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue