summaryrefslogtreecommitdiff
path: root/src/fc/fsconvert.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fc/fsconvert.c')
-rw-r--r--src/fc/fsconvert.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/fc/fsconvert.c b/src/fc/fsconvert.c
index 47239cf..6b694fd 100644
--- a/src/fc/fsconvert.c
+++ b/src/fc/fsconvert.c
@@ -22,7 +22,7 @@
*
* Author: Dave Lemke, Network Computing Devices, Inc
*/
-/* $XFree86: xc/lib/font/fc/fsconvert.c,v 1.11 2002/09/10 16:14:35 tsi Exp $ */
+/* $XFree86: xc/lib/font/fc/fsconvert.c,v 1.15 2003/09/01 20:50:43 herrb Exp $ */
/*
* FS data conversion
*/
@@ -36,6 +36,7 @@
#include "fontstruct.h"
#include "fservestr.h"
#include "fontutil.h"
+#include "fslibos.h"
extern char _fs_glyph_undefined;
extern char _fs_glyph_requested;
@@ -102,6 +103,10 @@ _fs_convert_props(fsPropInfo *pi, fsPropOffset *po, pointer pd,
nprops = pfi->nprops = pi->num_offsets;
+ if (nprops < 0
+ || nprops > SIZE_MAX/(sizeof(FontPropRec) + sizeof(char)))
+ return -1;
+
dprop = (FontPropPtr) xalloc(sizeof(FontPropRec) * nprops +
sizeof (char) * nprops);
if (!dprop)
@@ -351,11 +356,9 @@ _fs_clean_aborted_loadglyphs(FontPtr pfont, int num_expected_ranges,
fsRange *expected_ranges)
{
register FSFontPtr fsfont;
- register FSFontDataRec *fsd;
register int i;
fsfont = (FSFontPtr) pfont->fontPrivate;
- fsd = (FSFontDataRec *) pfont->fpePrivate;
if (fsfont->encoding)
{
fsRange full_range[1];
@@ -446,7 +449,6 @@ _fs_get_glyphs(FontPtr pFont, unsigned long count, unsigned char *chars,
CharInfoPtr encoding;
CharInfoPtr pDefault;
FSFontDataPtr fsd = (FSFontDataPtr) pFont->fpePrivate;
- int itemSize;
int err = Successful;
fsdata = (FSFontPtr) pFont->fontPrivate;
@@ -456,12 +458,6 @@ _fs_get_glyphs(FontPtr pFont, unsigned long count, unsigned char *chars,
numCols = pFont->info.lastCol - firstCol + 1;
glyphsBase = glyphs;
-
- if (charEncoding == Linear8Bit || charEncoding == TwoD8Bit)
- itemSize = 1;
- else
- itemSize = 2;
-
/* In this age of glyph caching, any glyphs gotten through this
procedure should already be loaded. If they are not, we are
dealing with someone (perhaps a ddx driver optimizing a font)
@@ -563,7 +559,6 @@ _fs_get_metrics(FontPtr pFont, unsigned long count, unsigned char *chars,
unsigned int r;
CharInfoPtr encoding;
CharInfoPtr pDefault;
- int itemSize;
fsdata = (FSFontPtr) pFont->fontPrivate;
encoding = fsdata->inkMetrics;
@@ -578,11 +573,6 @@ _fs_get_metrics(FontPtr pFont, unsigned long count, unsigned char *chars,
/* XXX - this should be much smarter */
/* make sure the glyphs are there */
- if (charEncoding == Linear8Bit || charEncoding == TwoD8Bit)
- itemSize = 1;
- else
- itemSize = 2;
-
switch (charEncoding) {
case Linear8Bit: