diff --git a/CHANGELOG.md b/CHANGELOG.md index 587bef691..2830b6c80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file. - SWF Add tag before/after menuitem - Context menu on bundles (ZIP, SWC, binarysearch, etc...) - Reloading SWF inside DefineBinaryData +- Working with byte ranges - caused problems when cloning tags ## [16.0.1] - 2022-10-31 ### Added diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java index 8e9b058d0..370d7e0e1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -318,7 +318,11 @@ public class SWFInputStream implements AutoCloseable { private SWF swf; public DumpInfo dumpInfo; + + private byte[] data; + private int limit; + public void addPercentListener(ProgressListener listener) { listeners.add(listener); } @@ -358,6 +362,8 @@ public class SWFInputStream implements AutoCloseable { public SWFInputStream(SWF swf, byte[] data, long startingPos, int limit) throws IOException { this.swf = swf; this.startingPos = startingPos; + this.data = data; + this.limit = limit; is = new MemoryInputStream(data, 0, limit); } @@ -810,10 +816,10 @@ public class SWFInputStream implements AutoCloseable { newDumpLevel(name, "bytes", specialType, specialValue); - int startPos = (int) getPos(); + int startPos = (int) is.getPos(); skipBytesEx(count); endDumpLevel(); - return new ByteArrayRange(swf.uncompressedData, startPos, (int) count); + return new ByteArrayRange(data, startPos, (int) count); } /**