IExternalizable handling in PlaceObject4 rather in SWFInputStream

This commit is contained in:
Jindra Petřík
2016-07-23 12:04:36 +02:00
parent 58f9ae982c
commit 4cc4c4c9e1
2 changed files with 9 additions and 7 deletions
@@ -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"));
}
/**
@@ -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);
}
}
}