From 5e14da97f16e421d084a9e735be21b1025150f0c Mon Sep 17 00:00:00 2001 From: Ritesh Khadgaray Date: Wed, 23 Oct 2013 17:29:07 -0400 Subject: pixman_trapezoid_valid(): Fix underflow when bottom is close to MIN_INT If t->bottom is close to MIN_INT (probably invalid value), subtracting top can lead to underflow which causes crashes. Attached patch will fix the issue. This fixes bug 67484. --- pixman/pixman.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pixman/pixman.h b/pixman/pixman.h index 7ff9fb5..509ba5e 100644 --- a/pixman/pixman.h +++ b/pixman/pixman.h @@ -1030,7 +1030,7 @@ struct pixman_triangle #define pixman_trapezoid_valid(t) \ ((t)->left.p1.y != (t)->left.p2.y && \ (t)->right.p1.y != (t)->right.p2.y && \ - (int) ((t)->bottom - (t)->top) > 0) + ((t)->bottom > (t)->top)) struct pixman_span_fix { -- cgit v1.2.3