fixed bug in poly2bitmap char clip detection
[swftools.git] / lib / pdf / BitmapOutputDev.cc
index ac5744b..e550b1b 100644 (file)
@@ -563,7 +563,7 @@ GBool BitmapOutputDev::clip0and1differ(int x1,int y1,int x2,int y2)
        int width8 = (width+7)/8;
        int height = clip0bitmap->getHeight();
 
-        if(fixBBox(&x1,&y1,&x2,&y2,width,height)) {
+        if(!fixBBox(&x1,&y1,&x2,&y2,width,height)) {
             /* area is outside or null */
             return gFalse;
         }
@@ -1412,7 +1412,9 @@ 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);
+        SplashFont*font = clip0dev->getCurrentFont();
+       SplashPath*path = font?font->getGlyphPath(code):NULL;
+
         if(!path) {
             if(code)
                 msg("<error> couldn't create outline for char %d", code);