Imported Debian patch 2:1.15.1-0ubuntu2.6
[deb_xorg-server.git] / debian / patches / pixman-validate.patch
CommitLineData
7217e0ca
ML
1diff --git a/exa/exa_render.c b/exa/exa_render.c
2index 172e2b5..807eeba 100644
3--- a/exa/exa_render.c
4+++ b/exa/exa_render.c
5@@ -1141,7 +1141,8 @@ exaTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
6
7 exaPrepareAccess(pPicture->pDrawable, EXA_PREPARE_DEST);
8 for (; ntrap; ntrap--, traps++)
9- (*ps->RasterizeTrapezoid) (pPicture, traps, -bounds.x1, -bounds.y1);
10+ if (xTrapezoidValid(traps))
11+ (*ps->RasterizeTrapezoid) (pPicture, traps, -bounds.x1, -bounds.y1);
12 exaFinishAccess(pPicture->pDrawable, EXA_PREPARE_DEST);
13
14 xRel = bounds.x1 + xSrc - xDst;
15diff --git a/render/picture.h b/render/picture.h
16index c85353a..49eb263 100644
17--- a/render/picture.h
18+++ b/render/picture.h
19@@ -211,7 +211,7 @@ typedef pixman_fixed_t xFixed;
20 /* whether 't' is a well defined not obviously empty trapezoid */
21 #define xTrapezoidValid(t) ((t)->left.p1.y != (t)->left.p2.y && \
22 (t)->right.p1.y != (t)->right.p2.y && \
23- (int) ((t)->bottom - (t)->top) > 0)
24+ (t)->bottom > 0 && (int) ((t)->bottom - (t)->top) > 0)
25
26 /*
27 * Standard NTSC luminance conversions: