git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix for segfault in case we couldn't extract a glyph outline
[swftools.git]
/
lib
/
pdf
/
BitmapOutputDev.cc
diff --git
a/lib/pdf/BitmapOutputDev.cc
b/lib/pdf/BitmapOutputDev.cc
index
6ed165d
..
5292f1a
100644
(file)
--- a/
lib/pdf/BitmapOutputDev.cc
+++ b/
lib/pdf/BitmapOutputDev.cc
@@
-269,6
+269,8
@@
void BitmapOutputDev::flushBitmap()
m.ty = ymin;
m.m00 = m.m11 = 1;
m.m10 = m.m01 = 0;
m.ty = ymin;
m.m00 = m.m11 = 1;
m.m10 = m.m01 = 0;
+ m.tx -= 0.5;
+ m.ty -= 0.5;
gfxline_t* line = gfxline_makerectangle(xmin, ymin, xmax, ymax);
dev->fillbitmap(dev, line, img, &m, 0);
gfxline_t* line = gfxline_makerectangle(xmin, ymin, xmax, ymax);
dev->fillbitmap(dev, line, img, &m, 0);
@@
-1262,6
+1264,11
@@
void BitmapOutputDev::drawChar(GfxState *state, double x, double y,
/* calculate the bbox of this character */
int x1 = (int)x, x2 = (int)x+1, y1 = (int)y, y2 = (int)y+1;
SplashPath*path = clip0dev->getCurrentFont()->getGlyphPath(code);
/* calculate the bbox of this character */
int x1 = (int)x, x2 = (int)x+1, y1 = (int)y, y2 = (int)y+1;
SplashPath*path = clip0dev->getCurrentFont()->getGlyphPath(code);
+ if(!path) {
+ if(code)
+ msg("<error> couldn't create outline for char %d", code);
+ return;
+ }
int t;
for(t=0;t<path->getLength();t++) {
double xx,yy;
int t;
for(t=0;t<path->getLength();t++) {
double xx,yy;