X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Frfxswf.c;h=d601a1550849d7fe508943bf6fdfa71c96a7b33c;hb=ebb61a567502ebe4b3d3c4b3284964600fecd90b;hp=bd8cd17ac2efee628f3859a5d795494f48b8bdfb;hpb=f5626be739a1e1b61f89d7a389be3c4b5d4d9128;p=swftools.git diff --git a/lib/rfxswf.c b/lib/rfxswf.c index bd8cd17..d601a15 100644 --- a/lib/rfxswf.c +++ b/lib/rfxswf.c @@ -1561,8 +1561,19 @@ int WriteExtraTags(SWF*swf, writer_t*writer) } swf_DeleteTag(0, fileattrib); } else { - if(swf_WriteTag2(writer, has_fileattributes)<0) - return -1; + if(swf->fileAttributes) { + /* if we're writing a file out again where we might have possible + modified the fileattributes in the header, adjust the tag data */ + TAG*tt = swf_CopyTag(0,has_fileattributes); + U32 flags = swf_GetU32(tt) | swf->fileAttributes; + swf_ResetTag(tt, tt->id); + swf_SetU32(tt, flags); + if(swf_WriteTag2(writer, has_fileattributes)<0) return -1; + swf_DeleteTag(0, tt); + } else { + if(swf_WriteTag2(writer, has_fileattributes)<0) + return -1; + } } if(0 && !has_scenedescription) { TAG*scene = swf_InsertTag(0, ST_SCENEDESCRIPTION);