Hi,
I've checkout the swftools from git and with pdf2swf I get a segmentation
fault in "polyops_startclip" on some pages from a PDF created with
Adobe InDesign CS4
---------------------------------------------------------------------------------------------------------
VERBOSE clearSoftMask statepos=3
VERBOSE Casting gfxline of 0 segments to a stroke-polygon
VERBOSE Casting gfxline of 5 segments (5 line segments) to a gfxpoly
VERBOSE Comparing polygon renderings of size 852x233 and 852x233
VERBOSE Bad SVP rewinding result- polygons don't match
VERBOSE Error in polygon processing
Segmentation fault
---------------------------------------------------------------------------------------------------------
It segmentation fault because "i->out" is null in "polyops_startclip" and
it's null because of a check that fails in:
"ArtSVP* run_intersector(ArtSVP*svp, ArtWindRule rule)"
When the check "if(!compare_bitmaps(&bbox, data1, data2)) {" fails it causes
the function to "return 0;", which is bad since the return apparently is
used later on.
I'm attaching a temporary patch that fixes the problem for me, but I'm sure
there must be a better solution, like figuring out why the two bitmaps are
different.
Yours
- Morten Sjøgren
diff --git a/lib/gfxpoly.c b/lib/gfxpoly.c
index a687e63..0af6bb3 100644
--- a/lib/gfxpoly.c
+++ b/lib/gfxpoly.c
@@ -956,8 +956,11 @@ ArtSVP* run_intersector(ArtSVP*svp, ArtWindRule rule)
if(art_error_in_intersector) {
msg("<verbose> Error in polygon processing");
- art_svp_free(result);
art_error_in_intersector=0;
+ if(current_svp == result){
+ return current_svp;
+ }
+ art_svp_free(result);
return 0;
}
return result;