git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
synchronized with downstream git
[swftools.git]
/
lib
/
modules
/
swfshape.c
diff --git
a/lib/modules/swfshape.c
b/lib/modules/swfshape.c
index
3163556
..
deb9b3a
100644
(file)
--- a/
lib/modules/swfshape.c
+++ b/
lib/modules/swfshape.c
@@
-21,6
+21,8
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include "../rfxswf.h"
+
#define SF_MOVETO 0x01
#define SF_FILL0 0x02
#define SF_FILL1 0x04
#define SF_MOVETO 0x01
#define SF_FILL0 0x02
#define SF_FILL1 0x04
@@
-347,7
+349,12
@@
int swf_ShapeSetMove(TAG * t,SHAPE * s,S32 x,S32 y)
b = swf_CountBits(x,0);
b = swf_CountBits(y,b);
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);
swf_SetBits(t,b,5);
swf_SetBits(t,x,b);
swf_SetBits(t,y,b);
@@
-418,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) {
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 */
/* 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 */
return -1;
} else {
/* split line */
@@
-467,7
+474,7
@@
int swf_ShapeSetCurve(TAG * t,SHAPE * s,S32 x,S32 y,S32 ax,S32 ay)
if(b >= 18) {
fprintf(stderr, "Bit overflow in swf_ShapeSetCurve- %d (%d,%d,%d,%d)\n", b, ax,ay,x,y);
if(b >= 18) {
fprintf(stderr, "Bit overflow in swf_ShapeSetCurve- %d (%d,%d,%d,%d)\n", b, ax,ay,x,y);
- b = 17;
+ return swf_ShapeSetLine(t, s, x+ax, y+ay);
}
swf_SetBits(t,2,2);
}
swf_SetBits(t,2,2);