From a20da0839c8d49e092991d259c2e73ea46e54af5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Thu, 28 Sep 2023 18:37:04 +0200 Subject: [PATCH] Fixed AS3 Nullpointer on getting multiname which is out of bounds --- CHANGELOG.md | 1 + libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef93694b3..bc8ccfec4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ All notable changes to this project will be documented in this file. - [#2086] AS3 direct editation - not deleting old nested methods when they have multiple usages - [#2009] Missing images in MacOs icon - AS3 Initialization of var in script initializer +- AS3 Nullpointer on getting multiname which is out of bounds ### Changed - [#2070] String values inside SWF to XML export are backslash escaped diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java index 0f525f1e6..2e81b8b6a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java @@ -476,8 +476,8 @@ public class ABC implements Openable { for (int ip = 0; ip < body.getCode().code.size(); ip++) { if (body.getCode().code.get(ip).definition instanceof CallPropertyIns) { int mIndex = body.getCode().code.get(ip).operands[0]; - if (mIndex > 0) { - Multiname m = constants.getMultiname(mIndex); + if (mIndex > 0 && mIndex < constants.getMultinameCount()) { + Multiname m = constants.getMultiname(mIndex); if (m.getNameWithNamespace(constants, true).toRawString().equals("flash.utils.getDefinitionByName")) { if (ip > 0) { if (body.getCode().code.get(ip - 1).definition instanceof PushStringIns) {