summaryrefslogtreecommitdiff
path: root/psprint
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2003-07-22 09:12:54 +0000
committerVladimir Glazounov <vg@openoffice.org>2003-07-22 09:12:54 +0000
commit5073e2b813d5790acdd0b39bd7dd893be97c1ae7 (patch)
tree56e98cc7b793b769097f990e3b6d5b8629b90bf9 /psprint
parenta5be84fe20cd6df4230cdde4388113ea878b57e7 (diff)
INTEGRATION: CWS pl02 (1.22.28); FILE MERGED
2003/07/21 12:52:19 pl 1.22.28.1: #i17138# do not crash on empty files
Diffstat (limited to 'psprint')
-rw-r--r--psprint/source/fontsubset/sft.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/psprint/source/fontsubset/sft.c b/psprint/source/fontsubset/sft.c
index 4810ed0c297d..b31cdb39be4c 100644
--- a/psprint/source/fontsubset/sft.c
+++ b/psprint/source/fontsubset/sft.c
@@ -2,9 +2,9 @@
*
* $RCSfile: sft.c,v $
*
- * $Revision: 1.22 $
+ * $Revision: 1.23 $
*
- * last change: $Author: rt $ $Date: 2003-04-17 15:10:44 $
+ * last change: $Author: vg $ $Date: 2003-07-22 10:12:54 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1593,6 +1593,12 @@ int OpenTTFont(const char *fname, sal_uInt32 facenum, TrueTypeFont** ttf) /*FOLD
t->fsize = st.st_size;
+ if (t->fsize == 0) {
+ ret = SF_BADFILE;
+ goto cleanup;
+ }
+
+
if ((t->ptr = (sal_uInt8 *) mmap(0, t->fsize, PROT_READ, MAP_SHARED, fd, 0)) == MAP_FAILED) {
ret = SF_MEMORY;
goto cleanup;