fix: stackoverflow on circular importassets (#2666)

Fixes #2666
This commit is contained in:
Jindra Petřík
2026-03-10 22:31:45 +01:00
parent 735dc148e6
commit a52126472a
5 changed files with 43 additions and 6 deletions

View File

@@ -2421,7 +2421,11 @@ public final class SWF implements SWFContainerItem, Timelined, Openable {
if (importedSwfs.containsKey(url)) {
iSwf = importedSwfs.get(url);
} else {
iSwf = resolver.resolveUrl(this.file, url);
if (resolver.doIgnoreUrl(this.file, url)) {
iSwf = null;
} else {
iSwf = resolver.resolveUrl(this.file, url);
}
importedSwfs.put(url, iSwf);
}
if (iSwf != null) {

View File

@@ -16,6 +16,8 @@
*/
package com.jpexs.decompiler.flash;
import java.util.Stack;
/**
* URL resolver interface.
*
@@ -31,4 +33,12 @@ public interface UrlResolver {
* @return SWF object or null if not valid
*/
public SWF resolveUrl(String basePath, String url);
/**
* Check whether to ignore this url
* @param basePath Base SWF path
* @param url URL
* @return True on ignore
*/
public boolean doIgnoreUrl(String basePath, String url);
}