From e1464270b6a90c1b1992edaf081fca4f06458a00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Fri, 12 Jan 2024 19:37:19 +0100 Subject: [PATCH] Fixed #2178 Tag undo --- .../src/com/jpexs/decompiler/flash/tags/Tag.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/Tag.java index 220d4358d..e353f7a48 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/Tag.java @@ -459,12 +459,12 @@ public abstract class Tag implements NeedsCharacters, Exportable, Serializable { return originalRange != null && isModified(); } - public void undo() throws InterruptedException, IOException { - byte[] data = getOriginalData(); - if (data == null) { //If the tag is newly created in GUI it has no original data + public void undo() throws InterruptedException, IOException { + if (originalRange == null) { //If the tag is newly created in GUI it has no original data return; } - SWFInputStream tagDataStream = new SWFInputStream(swf, data, getDataPos(), data.length); + SWFInputStream tagDataStream = new SWFInputStream(swf, originalRange.getArray(), 0, (int) originalRange.getPos() + originalRange.getLength()); + tagDataStream.seek(getDataPos()); readData(tagDataStream, getOriginalRange(), 0, false, true, false); setModified(false); }