git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Generated from configure.in
[swftools.git]
/
lib
/
rfxswf.c
diff --git
a/lib/rfxswf.c
b/lib/rfxswf.c
index
5fdc4c7
..
9b96235
100644
(file)
--- a/
lib/rfxswf.c
+++ b/
lib/rfxswf.c
@@
-31,6
+31,9
@@
#endif // HAVE_ZLIB_H
#endif // HAVE_LIBZ
#endif // HAVE_ZLIB_H
#endif // HAVE_LIBZ
+#define LAME
+#include "lame/lame.h"
+
#include "./bitio.h"
// internal constants
#include "./bitio.h"
// internal constants
@@
-347,6
+350,10
@@
int swf_SetRect(TAG * t,SRECT * r)
nbits = swf_CountBits(r->xmax,nbits);
nbits = swf_CountBits(r->ymin,nbits);
nbits = swf_CountBits(r->ymax,nbits);
nbits = swf_CountBits(r->xmax,nbits);
nbits = swf_CountBits(r->ymin,nbits);
nbits = swf_CountBits(r->ymax,nbits);
+ if(nbits>=32) {
+ fprintf(stderr, "rfxswf: Warning: num_bits overflow in swf_SetRect\n");
+ nbits=31;
+ }
swf_SetBits(t,nbits,5);
swf_SetBits(t,r->xmin,nbits);
swf_SetBits(t,nbits,5);
swf_SetBits(t,r->xmin,nbits);
@@
-747,6
+754,10
@@
void swf_FoldSprite(TAG * t)
fprintf(stderr, "Error: Sprite has no ID!");
return;
}
fprintf(stderr, "Error: Sprite has no ID!");
return;
}
+ if(t->len>4) {
+ /* sprite is already folded */
+ return;
+ }
t->pos = 0;
id = swf_GetU16(t);
t->pos = 0;
id = swf_GetU16(t);
@@
-853,6
+864,7
@@
int swf_WriteSWF2(struct writer_t*writer, SWF * swf) // Writes SWF to file,
TAG * t;
int frameCount=0;
struct writer_t zwriter;
TAG * t;
int frameCount=0;
struct writer_t zwriter;
+ int fileSize = 0;
if (!swf) return -1;
if (!swf) return -1;
@@
-898,8
+910,9
@@
int swf_WriteSWF2(struct writer_t*writer, SWF * swf) // Writes SWF to file,
l = swf_GetTagLen(&t2)+8;
}
l = swf_GetTagLen(&t2)+8;
}
+ fileSize = l+len;
if(len) {// don't touch headers without tags
if(len) {// don't touch headers without tags
- swf->fileSize = l+len;
+ swf->fileSize = fileSize;
swf->frameCount = frameCount;
}
swf->frameCount = frameCount;
}
@@
-946,7
+959,7
@@
int swf_WriteSWF2(struct writer_t*writer, SWF * swf) // Writes SWF to file,
writer->finish(writer); //e.g. flush zlib buffers
}
}
writer->finish(writer); //e.g. flush zlib buffers
}
}
- return (int)swf->fileSize;
+ return (int)fileSize;
}
int swf_WriteSWF(int handle, SWF * swf) // Writes SWF to file, returns length or <0 if fails
}
int swf_WriteSWF(int handle, SWF * swf) // Writes SWF to file, returns length or <0 if fails