Bug#335256: xserver-xorg: CID(Type1) font loader doesn't handle bitmap endian correctly (patch available)
Package: xserver-xorg
Version: 6.8.2.dfsg.1-7
Severity: important
CID format font loader does not handle fsBitmapFormat and
fsBitmapFormatMask correctly, and corrupts each glyph's bitmap image.
Here are some patches to fix this bug.
------------
--- xc/lib/font/Type1/t1intf.h.org 2005-03-01 02:35:18.000000000 +0900
+++ xc/lib/font/Type1/t1intf.h 2005-10-22 20:26:31.000000000 +0900
@@ -68,6 +68,7 @@
unsigned char *CIDdata;
long CIDsize;
#endif
+ fsBitmapFormatMask fmask;
} cidglyphs;
#endif
------------
------------
--- xc/lib/font/Type1/t1funcs.c.org 2005-03-01 02:35:18.000000000 +0900
+++ xc/lib/font/Type1/t1funcs.c 2005-10-22 20:28:34.000000000 +0900
@@ -443,6 +443,8 @@
cid->pixel_matrix[2] = vals->pixel_matrix[2];
cid->pixel_matrix[3] = vals->pixel_matrix[3];
+ cid->fmask = fmask;
+
pFont->fontPrivate = (unsigned char *)cid;
pFont->info.fontAscent =
@@ -1529,10 +1531,11 @@
long h,w;
long paddedW;
cidglyphs *cid;
- fsBitmapFormat format = 0;
- fsBitmapFormatMask fmask = 0;
+ fsBitmapFormat format = pFont->format;
+ fsBitmapFormatMask fmask;
cid = (cidglyphs *)pFont->fontPrivate;
+ fmask = cid->fmask;
/* set up default values */
FontDefaultFormat(&bit, &byte, &glyph, &scan);
------------
Reply to: