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

Bug#322550: [Fwd: CVS Update: xc (branch: trunk)]



tags 322550 + patch
thanks

On Thu, Aug 11, 2005 at 14:12:35 -0400, Michel Dänzer wrote:

> 
> This could be a fix for this bug.
> 

Hi,

David, is the attached patch acceptable for the 6.9 branch?

Cheers,
Julien Cristau
Index: debian/patches/series
===================================================================
--- debian/patches/series	(revision 650)
+++ debian/patches/series	(working copy)
@@ -1,3 +1,4 @@
+general/000_backport_from_HEAD.diff -p0
 general/000_backport_from_author_xterm.diff -p0
 general/000_stolen_from_linuxwacom_wacom_driver.diff -p0
 general/001_kernel_version_in_banner.diff -p0
Index: debian/patches/general/000_backport_from_HEAD.diff
===================================================================
--- debian/patches/general/000_backport_from_HEAD.diff	(revision 0)
+++ debian/patches/general/000_backport_from_HEAD.diff	(revision 0)
@@ -0,0 +1,62 @@
+$Id$
+
+Thu Aug 11 11:43:32 2005  SÞren Sandmann  <sandmann@redhat.com>
+
+      * programs/Xserver/hw/xfree86/xaa/xaaTEText.c
+      (XAAGlyphBltTEColorExpansion): Make sure we don't
+      crash on glyphs with NULL bits. Bug 659.
+
+Index: xc/programs/Xserver/hw/xfree86/xaa/xaaTEText.c
+===================================================================
+--- xc/programs/Xserver/hw/xfree86/xaa/xaaTEText.c.orig	2005-09-30 16:27:39.000000000 +0200
++++ xc/programs/Xserver/hw/xfree86/xaa/xaaTEText.c	2005-09-30 20:46:44.000000000 +0200
+@@ -253,6 +253,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);
+ 	    
+@@ -265,9 +266,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 
+@@ -280,12 +294,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++;

Property changes on: debian/patches/general/000_backport_from_HEAD.diff
___________________________________________________________________
Name: svn:keywords
   + Id

Index: debian/changelog
===================================================================
--- debian/changelog	(revision 650)
+++ debian/changelog	(working copy)
@@ -1,5 +1,6 @@
 xorg-x11 (6.8.99.900.dfsg.1-0pre2) UNRELEASED; urgency=low
 
+  [ David Nusinow ]
   * MANIFEST updates for the following
     + amd64 (Thanks Ari Pollak)
     + powerpc (Thanks Sven Luther)
@@ -21,8 +22,13 @@
     statically linked server to only shipping the debugging symbols in that
     package.
 
- -- David Nusinow <dnusinow@debian.org>  Thu, 29 Sep 2005 21:43:25 -0400
+  [ Julien Cristau ]
+  * Add patch by SÞren Sandmann to fix crash on fonts will NULL bits, stolen
+  from CVS HEAD. Thanks to Michel DÀnzer for pointing us to the fix.
+  (Closes: #322550)
 
+ -- Julien Cristau <julien.cristau@ens-lyon.org>  Fri, 30 Sep 2005 20:58:08 +0200
+
 xorg-x11 (6.8.99.900.dfsg.1-0pre1) experimental; urgency=low
 
   [ David Nusinow ]

Reply to: