Fixed: Flash player preview not stripping scripts from DefineSprites

This commit is contained in:
Jindra Petřík
2025-07-03 20:53:03 +02:00
parent 958428fb5c
commit 4128b98dbb
3 changed files with 23 additions and 2 deletions

View File

@@ -703,7 +703,7 @@ public class PreviewExporter {
doneCharacters.add(chId);
}
t.writeTag(sos);
t.writeTagNoScripts(sos);
if (t instanceof CharacterIdTag) {
List<CharacterIdTag> chIdTags = t.getSwf().getCharacterIdTags(((CharacterIdTag) t).getCharacterId());
if (chIdTags != null) {

View File

@@ -149,6 +149,26 @@ public class DefineSpriteTag extends DrawableTag implements Timelined {
sos.writeUI16(0);
}
}
@Override
public void getDataNoScript(SWFOutputStream sos) throws IOException {
sos.writeUI16(spriteId);
sos.writeUI16(frameCount);
ReadOnlyTagList tags = getTags();
for (Tag t : tags) {
if (t instanceof DoActionTag
|| t instanceof DoInitActionTag
|| t instanceof ABCContainerTag
|| t instanceof SymbolClassTag
|| t instanceof ExportAssetsTag) {
continue;
}
t.writeTagNoScripts(sos);
}
if (hasEndTag) {
sos.writeUI16(0);
}
}
@Override
public Timeline getTimeline() {
@@ -510,5 +530,5 @@ public class DefineSpriteTag extends DrawableTag implements Timelined {
@Override
public void setFrameCount(int frameCount) {
this.frameCount = frameCount;
}
}
}