git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added some error checks.
[swftools.git]
/
pdf2swf
/
swfoutput.cc
diff --git
a/pdf2swf/swfoutput.cc
b/pdf2swf/swfoutput.cc
index
0da570b
..
5e5e4da
100644
(file)
--- a/
pdf2swf/swfoutput.cc
+++ b/
pdf2swf/swfoutput.cc
@@
-996,13
+996,18
@@
SWFFont::SWFFont(char*name, int id, char*filename)
int t, outlinepos=0;
char*map[256];
int t, outlinepos=0;
char*map[256];
+ char*null = 0;
+ if(!a)
+ a=&null;
+
t=0;
while(a[t])
t++;
this->charnum = t;
t=0;
while(a[t])
t++;
this->charnum = t;
- if(!charnum)
- return;
+ if(!charnum) {
+ this->standardtablesize = 0;
+ }
msg("<verbose> Font %s(%d): Storing %d outlines.\n", FIXNULL(name), id, charnum);
this->standardtablesize = 256;
msg("<verbose> Font %s(%d): Storing %d outlines.\n", FIXNULL(name), id, charnum);
this->standardtablesize = 256;
@@
-1166,7
+1171,8
@@
SWFFont::~SWFFont()
}
free(ptr);
}
free(ptr);
- free(outline);
+ if(outline)
+ free(outline);
for(t=0;t<charnum;t++)
free(charname[t]);
for(t=0;t<standardtablesize;t++)
for(t=0;t<charnum;t++)
free(charname[t]);
for(t=0;t<standardtablesize;t++)