git.asbjorn.biz
/
swftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1f237fb
)
Fix: don't modify fileSize and frameCount in header when writing it
author
kramm
<kramm>
Thu, 30 May 2002 17:59:08 +0000
(17:59 +0000)
committer
kramm
<kramm>
Thu, 30 May 2002 17:59:08 +0000
(17:59 +0000)
with swf_WriteHeader().
lib/rfxswf.c
patch
|
blob
|
history
diff --git
a/lib/rfxswf.c
b/lib/rfxswf.c
index
f188d79
..
77e34d7
100644
(file)
--- a/
lib/rfxswf.c
+++ b/
lib/rfxswf.c
@@
-851,6
+851,7
@@
int swf_ReadSWF(int handle, SWF * swf)
int swf_WriteSWF2(struct writer_t*writer, SWF * swf, bool compress) // Writes SWF to file, returns length or <0 if fails
{ U32 len;
TAG * t;
int swf_WriteSWF2(struct writer_t*writer, SWF * swf, bool compress) // Writes SWF to file, returns length or <0 if fails
{ U32 len;
TAG * t;
+ int frameCount=0;
struct writer_t zwriter;
if (!swf) return -1;
struct writer_t zwriter;
if (!swf) return -1;
@@
-869,11
+870,11
@@
int swf_WriteSWF2(struct writer_t*writer, SWF * swf, bool compress) // Writ
len = 0;
t = swf->firstTag;
len = 0;
t = swf->firstTag;
- swf->frameCount = 0;
+ frameCount = 0;
while(t)
{ len += swf_WriteTag(-1, t);
while(t)
{ len += swf_WriteTag(-1, t);
- if (t->id==ST_SHOWFRAME) swf->frameCount++;
+ if (t->id==ST_SHOWFRAME) frameCount++;
t = swf_NextTag(t);
}
t = swf_NextTag(t);
}
@@
-896,7
+897,11
@@
int swf_WriteSWF2(struct writer_t*writer, SWF * swf, bool compress) // Writ
swf_SetU16(&t2, swf->frameCount);
l = swf_GetTagLen(&t2)+8;
}
swf_SetU16(&t2, swf->frameCount);
l = swf_GetTagLen(&t2)+8;
}
- swf->fileSize = l+len;
+
+ if(len) {// don't touch headers without tags
+ swf->fileSize = l+len;
+ swf->frameCount = frameCount;
+ }
if(compress) {
char*id = "CWS";
if(compress) {
char*id = "CWS";