aboutsummaryrefslogtreecommitdiffstats
path: root/main/pixman/CVE-2013-6425.patch
blob: b47a484dc603b529048348d7c28e466f919e6250 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From 5e14da97f16e421d084a9e735be21b1025150f0c Mon Sep 17 00:00:00 2001
From: Ritesh Khadgaray <khadgaray@gmail.com>
Date: Wed, 23 Oct 2013 21:29:07 +0000
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.
---
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 v0.9.0.2-2-gbebe