[gnome-print] Access off beginning of array causes FPE on Alpha



Hi,

The following brief patch fixes a problem where gfft2_move_to() is reading
an item at index -1 of an array.  On other platforms, this behavior probably
goes unnoticed, but on Alpha it leads to a floating point exception crash
because the location often does not contain a valid floating point number.  
This bug causes the print preview function to crash on Alpha.

--- gnome-font-face.c~  Fri Jan 11 22:52:59 2002
+++ gnome-font-face.c   Sat Mar 23 12:00:24 2002
@@ -724,7 +724,7 @@
        p.x = to->x * od->t[0] + to->y * od->t[2];
        p.y = to->x * od->t[1] + to->y * od->t[3];
 
-       if ((p.x != s->x3) || (p.y != s->y3)) {
+       if (od->end == 0 || (p.x != s->x3) || (p.y != s->y3)) {
                od->bp[od->end].code = ART_MOVETO;
                od->bp[od->end].x3 = to->x * od->t[0] + to->y * od->t[2];
                od->bp[od->end].y3 = to->x * od->t[1] + to->y * od->t[3];







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]