From 4a87908cd51ec33c11dbba376e870728db4bc7de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Fri, 4 Nov 2022 19:18:03 +0100 Subject: [PATCH] ValueTooLarge handling on few other places --- .../jpexs/decompiler/flash/importers/AS2ScriptImporter.java | 3 +++ .../decompiler/flash/console/CommandLineArgumentParser.java | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/AS2ScriptImporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/AS2ScriptImporter.java index 18f549a7d..5af2e3617 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/AS2ScriptImporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/AS2ScriptImporter.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.importers; +import com.jpexs.decompiler.flash.ValueTooLargeException; import com.jpexs.decompiler.flash.action.ConstantPoolTooBigException; import com.jpexs.decompiler.flash.action.parser.ActionParseException; import com.jpexs.decompiler.flash.action.parser.pcode.ASMParser; @@ -83,6 +84,8 @@ public class AS2ScriptImporter { ActionScript2Parser par = new ActionScript2Parser(asm.getSwf(), asm); try { asm.setActions(par.actionsFromString(txt)); + } catch (ValueTooLargeException ex) { + logger.log(Level.SEVERE, "Script or some of its functions are too large, file: {0}", fileName); } catch (ActionParseException ex) { logger.log(Level.SEVERE, "%error% on line %line%, file: %file%".replace("%error%", ex.text).replace("%line%", Long.toString(ex.line)).replace("%file%", fileName), ex); } catch (CompilationException ex) { diff --git a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java index 7d4b89179..9221a554d 100644 --- a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java +++ b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java @@ -27,6 +27,7 @@ import com.jpexs.decompiler.flash.SWFCompression; import com.jpexs.decompiler.flash.SWFSourceInfo; import com.jpexs.decompiler.flash.SearchMode; import com.jpexs.decompiler.flash.SwfOpenException; +import com.jpexs.decompiler.flash.ValueTooLargeException; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.RenameType; import com.jpexs.decompiler.flash.abc.ScriptPack; @@ -3615,6 +3616,9 @@ public class CommandLineArgumentParser { ActionScript2Parser par = new ActionScript2Parser(src.getSwf(), src); try { src.setActions(par.actionsFromString(as)); + } catch (ValueTooLargeException ex) { + System.err.println("Script or some of its functions are too large"); + System.exit(1); } catch (ActionParseException ex) { System.err.println("%error% on line %line%".replace("%error%", ex.text).replace("%line%", Long.toString(ex.line))); System.exit(1);