diff options
author | Philipp Lohmann <pl@openoffice.org> | 2001-06-27 16:17:56 +0000 |
---|---|---|
committer | Philipp Lohmann <pl@openoffice.org> | 2001-06-27 16:17:56 +0000 |
commit | e6fc8c6e7318a27b2b63001fb1e9cb33fe7b8cc4 (patch) | |
tree | 27d100f9f1cc0c4b486ff55f22d91729861b46c9 /psprint/source/fontsubset/sft.c | |
parent | b37ca4dd40f948a154927dba8647a145d781eb8b (diff) |
#85520# workaround for some broken fonts
Diffstat (limited to 'psprint/source/fontsubset/sft.c')
-rw-r--r-- | psprint/source/fontsubset/sft.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/psprint/source/fontsubset/sft.c b/psprint/source/fontsubset/sft.c index 9c14cd608145..01c770f560ba 100644 --- a/psprint/source/fontsubset/sft.c +++ b/psprint/source/fontsubset/sft.c @@ -2,9 +2,9 @@ * * $RCSfile: sft.c,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: pl $ $Date: 2001-06-26 19:23:12 $ + * last change: $Author: pl $ $Date: 2001-06-27 17:17:56 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,7 +59,7 @@ * ************************************************************************/ -/* $Id: sft.c,v 1.5 2001-06-26 19:23:12 pl Exp $ +/* $Id: sft.c,v 1.6 2001-06-27 17:17:56 pl Exp $ * Sun Font Tools * * Author: Alexander Gelfenbain @@ -1450,6 +1450,12 @@ static void GetKern(TrueTypeFont *ttf) for (i=0; i < ttf->nkern; i++) { ttf->kerntables[i] = ptr; ptr += GetUInt16(ptr, 2, 1); + // sanity check + if( ptr > ttf->ptr+ttf->fsize ) + { + free( ttf->kerntables ); + goto badtable; + } } return; } @@ -1464,6 +1470,12 @@ static void GetKern(TrueTypeFont *ttf) for (i = 0; i < ttf->nkern; i++) { ttf->kerntables[i] = ptr; ptr += GetUInt32(ptr, 0, 1); + // sanity check; there are some fonts that are broken in this regard + if( ptr > ttf->ptr+ttf->fsize ) + { + free( ttf->kerntables ); + goto badtable; + } } return; } |