always set the version to 6 if the file is zlib-compressed.
[swftools.git] / src / swfcombine.c
index 5273fb9..78af839 100644 (file)
@@ -288,7 +288,7 @@ static void makestackmaster(SWF*swf)
     TAG*tag;
     int t;
     SRECT box;
-    int fileversion = 1;
+    int fileversion = config.zlib?6:3;
     int frameRate = 256;
     RGBA rgb;
     rgb.r=rgb.b=rgb.g=0;
@@ -507,8 +507,8 @@ void changedepth(TAG*tag, int add)
        PUT16(&tag->data[0],GET16(&tag->data[0])+add);
     if(tag->id == ST_PLACEOBJECT2) {
        SWFPLACEOBJECT obj;
-       swf_SetTagPos(tag, 0);
        U8 flags;
+       swf_SetTagPos(tag, 0);
        flags = swf_GetU8(tag);
        if(flags&2) swf_GetU16(tag); //id
        if(flags&4) swf_GetMatrix(tag, 0);
@@ -1218,9 +1218,11 @@ int main(int argn, char *argv[])
 
     fi = open(outputname, O_BINARY|O_RDWR|O_TRUNC|O_CREAT, 0777);
 
-    if(config.zlib)
+    if(config.zlib) {
+       if(newswf.fileVersion < 6)
+           newswf.fileVersion = 6;
        swf_WriteSWC(fi, &newswf);
-    else {
+    } else {
        newswf.compressed = 0;
        swf_WriteSWF(fi, &newswf);
     }