Skip to content

avm2: Parity with SWFv9 and SWFv10 for invalid gotoAndStop parameters - #24741

Merged
Lord-McSweeney merged 2 commits into
ruffle-rs:masterfrom
lsaa:fix/invalid-goto-handling
Oct 1, 2026
Merged

Lord-McSweeney merged 2 commits into
ruffle-rs:masterfrom
lsaa:fix/invalid-goto-handling

Conversation

@lsaa

@lsaa lsaa commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Description

SWFv9 and SWFv10 NOOP when given invalid gotos inside frame scripts. This doesn't affect v11+ since those crash earlier if given invalid values. This only touches frame scripts, outside of those it should still set invalid frames to frame 1.

Testing

Added an unit test (d6a8687) for this that fails if it doesn't NOOP the goto expression.

In Super Crazy Guitar Maniac Deluxe 2 you'd always get a bronze medal sprite no matter your score since it's the first frame and the game sends an undefined goto. Game displays it properly on all official Flash players I tested.

Before (ruffle 0.6.0) After
hollywisefc hollywisefcnewresize
flashplayer (Linux) Flash Player 32 (Windows)
hollywisefcnewresizelin hollywisefcnewresizewin

Checklist

  • I, a human, have self-reviewed this PR and fully understand the changes within.
  • I have made or updated tests where possible.
  • All of my commits are properly scoped, compile successfully, and pass all tests.
  • This PR does not make sense to split up into smaller PRs.
  • An LLM was involved in the authoring of this code.

@kjarosh kjarosh added A-avm2 Area: AVM2 (ActionScript 3) T-compat Type: Compatibility with Flash Player labels Sep 21, 2026
@Lord-McSweeney
Lord-McSweeney self-requested a review September 21, 2026 01:09
@lsaa
lsaa force-pushed the fix/invalid-goto-handling branch from d6a8687 to 7bd0522 Compare September 21, 2026 08:43
@Lord-McSweeney

Copy link
Copy Markdown
Member

This should fix #24501

@Lord-McSweeney Lord-McSweeney linked an issue Sep 30, 2026 that may be closed by this pull request
@lsaa
lsaa force-pushed the fix/invalid-goto-handling branch from 7bd0522 to 16f1a39 Compare October 1, 2026 03:19
@lsaa

lsaa commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

This should fix #24501

image

Confirmed

@lsaa
lsaa force-pushed the fix/invalid-goto-handling branch 2 times, most recently from c8e69c9 to 09fbdb1 Compare October 1, 2026 04:36
@lsaa

lsaa commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Two of the tests from #24816 pass now so I removed known_failure from them. The holdout is the swf9 one but fixing it isn't in the scope of this PR.

@Lord-McSweeney Lord-McSweeney added the squash-on-merge Marks a PR to be squashed before merging. label Oct 1, 2026

@Lord-McSweeney Lord-McSweeney left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much!

lsaa added 2 commits October 1, 2026 08:34
Makes invalid avm2 MovieClip goto NOOP inside frame scripts on SWFv9
and SWFv10 instead of setting them to frame 1.
@Lord-McSweeney
Lord-McSweeney force-pushed the fix/invalid-goto-handling branch from 09fbdb1 to 2d205a9 Compare October 1, 2026 15:34
@Lord-McSweeney
Lord-McSweeney merged commit e092c78 into ruffle-rs:master Oct 1, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-avm2 Area: AVM2 (ActionScript 3) newsworthy squash-on-merge Marks a PR to be squashed before merging. T-compat Type: Compatibility with Flash Player

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Super Crazy Guitar Maniac Deluxe 3: wrong medal graphics

4 participants