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);
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 */