]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/gpdf/files/007_CVE-2006-0301.patch
gpdf: add 2.10.0-4 from Debian.
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / gpdf / files / 007_CVE-2006-0301.patch
1 diff -u -p -Nr --exclude CVS splash/Splash.cc splash/Splash.cc
2 --- splash/Splash.cc    2004-05-17 20:10:49.000000000 +0200
3 +++ splash/Splash.cc    2006-02-04 17:54:51.000000000 +0100
4 @@ -734,6 +734,10 @@ void Splash::drawPixel(int x, int y, Spl
5    SplashMono1P *mono1;
6    SplashBGR8P *bgr8;
7  
8 +  if ( (unsigned) x >= (unsigned) bitmap->getWidth() ||
9 +       (unsigned) y >= (unsigned) bitmap->getHeight())
10 +    return;
11 +
12    if (noClip || state->clip->test(x, y)) {
13      color = pattern->getColor(x, y);
14      switch (bitmap->mode) {
15 @@ -771,6 +775,11 @@ void Splash::drawSpan(int x0, int x1, in
16    SplashMono1 mask1;
17    int i, j, n;
18  
19 +  if ((unsigned) x0 >= (unsigned) bitmap->getWidth() ||
20 +      (unsigned) x1 >= (unsigned) bitmap->getWidth() ||
21 +      (unsigned) y >= (unsigned) bitmap->getHeight())
22 +    return;
23 +
24    n = x1 - x0 + 1;
25  
26    switch (bitmap->mode) {
27 @@ -858,6 +867,11 @@ void Splash::xorSpan(int x0, int x1, int
28  
29    n = x1 - x0 + 1;
30  
31 +  if ((unsigned) x0 >= (unsigned) bitmap->getWidth() ||
32 +      (unsigned) x1 >= (unsigned) bitmap->getWidth() ||
33 +      (unsigned) y >= (unsigned) bitmap->getHeight())
34 +    return;
35 +
36    switch (bitmap->mode) {
37    case splashModeMono1:
38      mono1 = &bitmap->data.mono8[y * bitmap->rowSize + (x0 >> 3)];