--- greeter/Login.c 2006-02-23 12:07:00.000000000 -0300 +++ greeter/Login_patch.c 2006-02-23 12:02:39.000000000 -0300 @@ -213,7 +213,7 @@ w->login.greeting, strlen (w->login.greeting)), \ XTextWidth (w->login.greetFont,\ w->login.unsecure_greet, strlen (w->login.unsecure_greet)))) + w->login.logoWidth + (2*w->login.logoPadding) -#endif /* XPM */ +#endif /* qXPM */ # define LOGIN_X(w) (2 * PROMPT_X_INC(w)) # define LOGIN_Y(w) (GREET_Y(w) + GREET_Y_INC(w) +\ w->login.greetFont->max_bounds.ascent + Y_INC(w)) @@ -1030,6 +1030,7 @@ #endif #ifdef XPM + int rv=0; myXGCV.foreground = w->login.hipixel; myXGCV.background = w->core.background_pixel; valuemask = GCForeground | GCBackground; @@ -1101,6 +1102,7 @@ if (NULL != w->login.logoFileName) { + XpmAttributes myAttributes = { 0 }; Window tmpWindow = { 0 }; struct stat myBuffer = { 0 }; @@ -1117,13 +1119,24 @@ myAttributes.valuemask |= XpmReturnPixels; myAttributes.valuemask |= XpmReturnExtensions; - XpmReadFileToPixmap(XtDisplay(w), /* display */ + /* + * Patch for invalid xpm files go trougth an infinite loop.... + * Costantino Leandro + */ + rv = XpmReadFileToPixmap(XtDisplay(w), /* display */ RootWindowOfScreen(XtScreen(w)), /* window */ w->login.logoFileName, /* XPM filename */ &(w->login.logoPixmap), /* pixmap */ &(w->login.logoMask), /* pixmap mask */ &myAttributes); /* XPM attributes */ - w->login.logoValid = True; + + if( rv < 0 ) + { + LogError("Cannot load xpm. Invalid Format or not recognized.\n"); + goto SkipXpmLoad; + } + + w->login.logoValid = True; XGetGeometry(XtDisplay(w), w->login.logoPixmap, &tmpWindow,