X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Frfxswf.c;h=9b962355d6df9ce123e5d3da2ad0058fcdf75d73;hp=6eb49b7f4ebeb247e06d5901d6630b55332c6d43;hb=de0e909835e1cb1d2c0bb675f4dbed62bb452a9c;hpb=9477c328f97ca1221fe8aac0daa3f49c59c1d1d5 diff --git a/lib/rfxswf.c b/lib/rfxswf.c index 6eb49b7..9b96235 100644 --- a/lib/rfxswf.c +++ b/lib/rfxswf.c @@ -864,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; + int fileSize = 0; if (!swf) return -1; @@ -909,8 +910,9 @@ int swf_WriteSWF2(struct writer_t*writer, SWF * swf) // Writes SWF to file, l = swf_GetTagLen(&t2)+8; } + fileSize = l+len; if(len) {// don't touch headers without tags - swf->fileSize = l+len; + swf->fileSize = fileSize; swf->frameCount = frameCount; } @@ -957,7 +959,7 @@ int swf_WriteSWF2(struct writer_t*writer, SWF * swf) // Writes SWF to file, 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