Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37847405
en ru br
Репозитории ALT
4.0: 7.3.0-alt1
3.0: 6.8.2-alt18
+updates:6.8.2-alt24
www.altlinux.org/Changes

Группа :: Система/X11
Пакет: xorg-x11

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: xorg-x11-6.8.2-fix-font-crash.patch
Скачать


--- xc/programs/Xserver/hw/xfree86/xaa/xaaTEText.c.orig	2005-03-04 10:04:01.238775184 -0500
+++ xc/programs/Xserver/hw/xfree86/xaa/xaaTEText.c	2005-03-04 10:04:04.414292432 -0500
@@ -249,6 +249,7 @@
 	RightEdge = min(Right, pbox->x2);
 
 	if(RightEdge > LeftEdge) {	/* we have something to draw */
+	    unsigned int *fallbackBits = NULL;
 	    ytop = max(Top, pbox->y1);
 	    ybot = min(Bottom, pbox->y2);
 	    
@@ -261,9 +262,22 @@
 		int count;
 		glyphs = (unsigned int**)(infoRec->PreAllocMem);
 
-		for(count = 0; count < nglyph; count++) 
+		for(count = 0; count < nglyph; count++) {
  			glyphs[count] = (unsigned int*) 
 				FONTGLYPHBITS(gBase,*ppci++);
+			if (!glyphs[count]) {
+			    /* Glyphs with NULL bits do exist in the wild.
+			       Replace with blank bits in that case */
+			    
+			    if (!fallbackBits) {
+				int fontHeight = Bottom - Top + 1;
+				fallbackBits = xcalloc (glyphWidth * fontHeight, 1);
+				if (!fallbackBits)
+				    return;
+			    }
+			    glyphs[count] = fallbackBits;
+			}
+		}
 
 		/* our new unrolled TE code only writes DWORDS at a time 
 		   so it can read up to 6 characters past the last one 
@@ -276,12 +290,15 @@
 		glyphs[count + 5] = glyphs[0];
 	    }
 
-   /* x, y, w, h, skipleft, skiptop, glyphp, glyphWidth, fg, bg, rop, pm */
+    /* x, y, w, h, skipleft, skiptop, glyphp, glyphWidth, fg, bg, rop, pm */
 
 	    (*infoRec->TEGlyphRenderer)( pScrn, 
 		LeftEdge, ytop, RightEdge - LeftEdge, ybot - ytop, 
 		skippix, ytop - Top, glyphs + skipglyphs, glyphWidth, 
-		fg, bg, rop, planemask); 
+		fg, bg, rop, planemask);
+
+	    if (fallbackBits)
+		xfree (fallbackBits);
 	}
 
 	nbox--; pbox++;
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin