Contents of /trunk/kdegraphics/patches/post-3.5.1-kdegraphics-CVE-2006-0301.diff
Parent Directory | Revision Log
Revision 144 -
(show annotations)
(download)
Tue May 8 20:06:05 2007 UTC (17 years, 4 months ago) by niro
File size: 1684 byte(s)
Tue May 8 20:06:05 2007 UTC (17 years, 4 months ago) by niro
File size: 1684 byte(s)
-import
1 | --- kpdf/xpdf/splash/SplashXPathScanner.cc (Revision 505052) |
2 | +++ kpdf/xpdf/splash/SplashXPathScanner.cc (Arbeitskopie) |
3 | @@ -186,7 +186,7 @@ GBool SplashXPathScanner::getNextSpan(in |
4 | } |
5 | |
6 | void SplashXPathScanner::computeIntersections(int y) { |
7 | - SplashCoord ySegMin, ySegMax, xx0, xx1; |
8 | + SplashCoord xSegMin, xSegMax, ySegMin, ySegMax, xx0, xx1; |
9 | SplashXPathSeg *seg; |
10 | int i, j; |
11 | |
12 | @@ -236,19 +236,27 @@ void SplashXPathScanner::computeIntersec |
13 | } else if (seg->flags & splashXPathVert) { |
14 | xx0 = xx1 = seg->x0; |
15 | } else { |
16 | - if (ySegMin <= y) { |
17 | - // intersection with top edge |
18 | - xx0 = seg->x0 + ((SplashCoord)y - seg->y0) * seg->dxdy; |
19 | + if (seg->x0 < seg->x1) { |
20 | + xSegMin = seg->x0; |
21 | + xSegMax = seg->x1; |
22 | } else { |
23 | - // x coord of segment endpoint with min y coord |
24 | - xx0 = (seg->flags & splashXPathFlip) ? seg->x1 : seg->x0; |
25 | + xSegMin = seg->x1; |
26 | + xSegMax = seg->x0; |
27 | } |
28 | - if (ySegMax >= y + 1) { |
29 | - // intersection with bottom edge |
30 | - xx1 = seg->x0 + ((SplashCoord)y + 1 - seg->y0) * seg->dxdy; |
31 | - } else { |
32 | - // x coord of segment endpoint with max y coord |
33 | - xx1 = (seg->flags & splashXPathFlip) ? seg->x0 : seg->x1; |
34 | + // intersection with top edge |
35 | + xx0 = seg->x0 + ((SplashCoord)y - seg->y0) * seg->dxdy; |
36 | + // intersection with bottom edge |
37 | + xx1 = seg->x0 + ((SplashCoord)y + 1 - seg->y0) * seg->dxdy; |
38 | + // the segment may not actually extend to the top and/or bottom edges |
39 | + if (xx0 < xSegMin) { |
40 | + xx0 = xSegMin; |
41 | + } else if (xx0 > xSegMax) { |
42 | + xx0 = xSegMax; |
43 | + } |
44 | + if (xx1 < xSegMin) { |
45 | + xx1 = xSegMin; |
46 | + } else if (xx1 > xSegMax) { |
47 | + xx1 = xSegMax; |
48 | } |
49 | } |
50 | if (xx0 < xx1) { |