From 4cc4c4c9e1a5ca931bac505801ef5547321077dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sat, 23 Jul 2016 12:04:36 +0200 Subject: [PATCH] IExternalizable handling in PlaceObject4 rather in SWFInputStream --- .../src/com/jpexs/decompiler/flash/SWFInputStream.java | 9 +++------ .../com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java | 7 ++++++- 2 files changed, 9 insertions(+), 7 deletions(-) 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 7649ff95b..fb7fc28f6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -768,14 +768,11 @@ public class SWFInputStream implements AutoCloseable { * @return * @throws IOException */ - public Amf3Value readAmf3Object(String name) throws IOException { + public Amf3Value readAmf3Object(String name) throws IOException, NoSerializerExistsException { Amf3InputStream ai = new Amf3InputStream(is); ai.dumpInfo = this.dumpInfo; - try { - return new Amf3Value(ai.readValue("amfData")); - } catch (NoSerializerExistsException nse) { - return new Amf3Value(nse.getIncompleteData()); - } + + return new Amf3Value(ai.readValue("amfData")); } /** diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java index 311ac8011..22c51c9c3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java @@ -359,7 +359,12 @@ public class PlaceObject4Tag extends PlaceObjectTypeTag implements ASMSourceCont clipActions = sis.readCLIPACTIONS(swf, this, "clipActions"); } if (sis.available() > 0) { - amfData = sis.readAmf3Object("amfValue"); + try { + amfData = sis.readAmf3Object("amfValue"); + } catch (NoSerializerExistsException nse) { + amfData = new Amf3Value(nse.getIncompleteData()); + Logger.getLogger(PlaceObject4Tag.class.getName()).log(Level.WARNING, "AMFData in PlaceObject4 contains IExternalizable object which cannot be read. Data object is truncated.", nse); + } } }