ruffle icon indicating copy to clipboard operation
ruffle copied to clipboard

にょにょけーね / Plant on Head: Latest Ruffle and Flash Player cannot read SWF, but earlier versions work

Open n0samu opened this issue 1 year ago • 2 comments

Describe the bug

This old Touhou animation plays in the old version of Ruffle (2022-11-09) included on Dagobah, but the latest version of Ruffle panics when trying to open it:

panicked at core/src/context.rs:367:40:
Unknown SWF version 8

The latest version of Flash Player also crashes when trying to open this file, but Flash Player 9 plays it fine. You can download the Flash Player 9 projector from here.

Expected behavior

Ideally Ruffle would be able to play the file since old versions of Flash Player could. But I guess it would be more realistic to simply improve the error message. I assume the SWF file is malformed somehow, so the error should mention that instead of complaining about the Flash file version, which is not "unknown".

Content Location

Page URL: https://dagobah.net/flash/plant_on_head.swf To download the SWF file, click the save icon at the top of the page.

Affected platform

Desktop app

Operating system

Windows 10

Browser

No response

Additional information

No response

n0samu avatar May 01 '24 19:05 n0samu

AVM2 was introduced with 9, and Ruffle maps specific versions to their capabilities. It treats anything below 9 as unknown.

https://github.com/ruffle-rs/ruffle/blob/99eaf7ac2c36dfe7cc81afa48217002d8a894817/core/src/avm2/api_version.rs#L146

I wonder how an swf without any scripts got both the the actionScript3 file attribute and given version 8?

colin969 avatar May 01 '24 20:05 colin969

Ooh, I see! I can confirm that changing the actionScript3 flag to false in JPEXS fixes the SWF in both Flash and Ruffle. As for how it got set in the first place, I have no idea!

n0samu avatar May 01 '24 21:05 n0samu