From: Ritesh Khadgaray Date: Wed, 23 Oct 2013 21:29:07 +0000 (-0400) Subject: pixman_trapezoid_valid(): Fix underflow when bottom is close to MIN_INT X-Git-Tag: pixman-0.31.2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5e14da97f16e421d084a9e735be21b1025150f0c;p=platform%2Fupstream%2Fpixman.git 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. --- 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 {