X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswfshape.c;h=d51f51072660534636e5f30fbbd35577d197668f;hb=1f86ebaac605b62901bd103b1f23b53979acc5a4;hp=b7152484c4461e5be9b0e7564f38be5439f6d2c3;hpb=644837a3d0f18ac76d55c9ba438246cb5a2927d6;p=swftools.git diff --git a/lib/modules/swfshape.c b/lib/modules/swfshape.c index b715248..d51f510 100644 --- a/lib/modules/swfshape.c +++ b/lib/modules/swfshape.c @@ -349,7 +349,12 @@ int swf_ShapeSetMove(TAG * t,SHAPE * s,S32 x,S32 y) b = swf_CountBits(x,0); b = swf_CountBits(y,b); - + + if(b>31) { + fprintf(stderr, "Warning: bad moveTo (%f,%f)\n", x/20.0, y/20.0); + b=31; + } + swf_SetBits(t,b,5); swf_SetBits(t,x,b); swf_SetBits(t,y,b); @@ -420,9 +425,9 @@ int swf_ShapeSetLine(TAG * t,SHAPE * s,S32 x,S32 y) b = swf_CountBits(y,b); if (b<2) b=2; if(b >= 18) { - if(b >= 18 + 6) { + if(b > 18 + 6) { /* do not split into more than 64 segments. If the line is *that* long, something's broken */ - fprintf(stderr, "Warning: Line to %.2f,%.2f is too long\n", (double)x,(double)y); + fprintf(stderr, "Warning: Line to %.2f,%.2f is too long (%d bits)\n", (double)x,(double)y, b); return -1; } else { /* split line */