mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-29 10:24:38 +00:00
Fixed: #2405 Incorrect saving tags after Cloning / Copy-pasting
This commit is contained in:
@@ -581,9 +581,15 @@ public abstract class Tag implements NeedsCharacters, Exportable, Serializable {
|
||||
* @throws IOException On I/O error
|
||||
*/
|
||||
public Tag cloneTag() throws InterruptedException, IOException {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
byte[] data = getData();
|
||||
byte[] headerData = getHeader(data.length);
|
||||
baos.write(headerData);
|
||||
baos.write(data);
|
||||
|
||||
byte[] dataWithHeader = baos.toByteArray();
|
||||
SWFInputStream tagDataStream = new SWFInputStream(swf, data, 0, data.length);
|
||||
TagStub copy = new TagStub(swf, getId(), "Unresolved", new ByteArrayRange(data), tagDataStream);
|
||||
TagStub copy = new TagStub(swf, getId(), "Unresolved", new ByteArrayRange(dataWithHeader), tagDataStream);
|
||||
copy.forceWriteAsLong = forceWriteAsLong;
|
||||
return SWFInputStream.resolveTag(copy, 0, false, true, false, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user