From 7b23b1670f0d6287ece113498037f24e0eab9545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sat, 7 Mar 2015 21:17:56 +0100 Subject: [PATCH] SWFs in zip based bundles saving fixed --- .../src/com/jpexs/decompiler/flash/ZippedSWFBundle.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/ZippedSWFBundle.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/ZippedSWFBundle.java index f3fcc5d67..13758ab77 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/ZippedSWFBundle.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/ZippedSWFBundle.java @@ -160,8 +160,7 @@ public class ZippedSWFBundle implements SWFBundle { while ((entryIn = zis.getNextEntry()) != null) { InputStream src; if (entryIn.getName().equals(key)) { - entryOut = new ZipEntry(entryIn); - entryOut.setSize(swfData.length); + entryOut = new ZipEntry(key); src = new ByteArrayInputStream(swfData); } else { src = zis; @@ -169,11 +168,11 @@ public class ZippedSWFBundle implements SWFBundle { } zos.putNextEntry(entryOut); Helper.copyStream(src, zos, entryOut.getSize() == -1 ? Long.MAX_VALUE : entryOut.getSize()); + zos.closeEntry(); + zis.closeEntry(); } } finally { - zis.closeEntry(); zis.close(); - zos.closeEntry(); zos.close(); } this.is.close();