Commit Graph

4664 Commits

Author SHA1 Message Date
relrelb 72531eddff avm1: Cleanup CallMethod 2021-05-12 20:47:06 -07:00
relrelb 2e0bc78cd6 avm1: Fix variadic arguments
Previously, if the arguments count was greater than the actual
stack size, then a stack underflow occurred which resulted in a
sequence of undefined values. That didn't match Flash's behavior.

Also, this prevents potential huge allocations that hang Ruffle.

In addition, num_args seems like it should use coerce_to_u32
(wraps at 4294967297). This also means that -1 ends up acting like
u32::MAX and would pop all values off of the stack.
2021-05-12 20:47:06 -07:00
Eduardo Sánchez Muñoz e3dc8ff28e swf: SwfStr: reimplement `Debug` with `std::ascii::escape_default`
The string will now be surrounded with quotes (`"`), non-ASCII characters (UTF-8 or not) will be escaped in hexadecimal form (`\xNN`) and ASCII control characters will be escaped (`\x01`, `\n`, `\t`).
2021-05-12 10:53:26 -07:00
Mike Welsh 9538647422 tests: Fix swf::Fixed tests in --release (fix #4313)
Use `#[cfg_attr(debug_assertions, should_panic)]` to ensure that
the tests only expect to panic in debug builds.

Fixes #4313.
2021-05-11 20:53:23 -07:00
relrelb 7acf0349c3 desktop: Refactor main.rs 2021-05-11 18:58:08 -07:00
Mike Welsh ea4ea9922a chore: Bump rustfft
Bump rustfft to 5.1.1, which fixes this issue affecting our nightly
build:

https://github.com/ejmahler/RustFFT/issues/74
2021-05-10 17:33:16 -07:00
dependabot[bot] dd5894ebd6 chore: Bump wgpu from 0.8.0 to 0.8.1
Bumps [wgpu](https://github.com/gfx-rs/wgpu-rs) from 0.8.0 to 0.8.1.
- [Release notes](https://github.com/gfx-rs/wgpu-rs/releases)
- [Changelog](https://github.com/gfx-rs/wgpu-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gfx-rs/wgpu-rs/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-10 10:16:10 -07:00
dependabot[bot] 8e91f8dc89 chore: Bump enum-map from 1.0.0 to 1.1.0
Bumps [enum-map](https://gitlab.com/KonradBorowski/enum-map) from 1.0.0 to 1.1.0.
- [Release notes](https://gitlab.com/KonradBorowski/enum-map/tags)
- [Changelog](https://gitlab.com/KonradBorowski/enum-map/blob/master/CHANGELOG.md)
- [Commits](https://gitlab.com/KonradBorowski/enum-map/commits/master)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-10 10:15:58 -07:00
dependabot[bot] 62301dea54 chore: Bump syn from 1.0.71 to 1.0.72
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.71 to 1.0.72.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.71...1.0.72)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-10 09:40:26 -07:00
Adrian Wielgosik c40d08e73a web: Fix context menu checkmark in web builds 2021-05-10 00:19:29 -07:00
Mike Welsh 6051ee4cb1 core: Disallow .. in shared object paths (fix #3961)
Toss out any shared objects that contain ".." in the name
to avoid accessing files outside of the Ruffle data directory.

The DiskStorageBackend also will fail any requests with a ".."
component as an extra precaution.

Fixes #3961.
2021-05-09 23:20:32 -07:00
Mike Welsh 339f0e2862 desktop: Append .sol extension to SharedObject files
Also, prefix the shared object name with # if it contains a
slash, (e.g. `#mygame/foo`). This matches Flash's directory
structure and makes it easier to transfer saved data to Ruffle.
2021-05-09 23:20:32 -07:00
CUB3D 61298b2be3 avm1: Add parsing of legacy json SharedObjects for backwards compatability 2021-05-09 23:20:32 -07:00
CUB3D f4a9446829 avm1: Fix tests for SharedObject 2021-05-09 23:20:32 -07:00
CUB3D 07336c306a avm1: Add test for generated file 2021-05-09 23:20:32 -07:00
CUB3D c398aded68 chore: Remove debug printing 2021-05-09 23:20:32 -07:00
CUB3D cd1cde1708 avm1: Implement de/serialization of shared objects into Flash Player Lso format 2021-05-09 23:20:32 -07:00
Pablo Rodríguez 3acfb5bc29
i18n: Minor improvement in Spanish translation 2021-05-09 10:57:27 -07:00
Ahmet Akkoç d2bf69d5e6
i18n: Added Turkish localization 2021-05-08 03:14:23 -07:00
relrelb 6b6b335440 avm1: Use bitflags for Array.sort flags 2021-05-08 01:37:05 -07:00
Mike Welsh ba7fd1b2b9 chore: Appease clippy, bump url
Bump url and avoid `Url::into_string` deprecation warnings.
Fix `single_char_pattern` clippy lints.
2021-05-07 20:51:26 -07:00
Mike Welsh 66b144e49b ci: Run apt-get update
GitHub Actions runners updated to Ubuntu 20.04, so run apt-get
update to ensure we can install our Linux dependencies (namely
libasound2).
2021-05-07 20:05:17 -07:00
relrelb b2bc24919a avm1: Replace `current_swf_version` with `swf_version`
They happen to be identical, and `swf_version` is more idomatic.
2021-05-07 13:26:20 -07:00
Mike Welsh e35933aeee desktop: Fix window size calculation
Change width/height CLI paramters to `f64`, and also clamp window
size to minimum of 1x1 to prevent panics from invalid window
dimensions.
2021-05-06 17:56:35 -07:00
Mike Welsh ef617eebad avm1: Use `set_html_text` when initializing textfield from a variable binding
If a textfield was created with a variable binding, and the variable
already existed, the initial text of the textfield is set to the
variable value. However, this was not obeying the HTML setting of
the text field, so HTML tags were mistakenly shown in some content.

Fixes #3522.
2021-05-06 16:58:33 -07:00
Nicolas F 423fcf5019 desktop: add parameters to specify window size
This adds two optional parameters, --width and --height, which
allow the user to specify a desired physical window width and
height to be used. If only one of the two parameters is present,
the other will be deduced from it and the movie's aspect ratio.

If neither are present, the window's size is set to the movie's
logical size, in accordance with the behaviour before this change.
2021-05-06 15:58:41 -07:00
Adrian Wielgosik 5319a5bb81 Remove lifetime from constants 2021-05-06 10:54:33 -07:00
Adrian Wielgosik faa0e50e89 avm2: Unify NativeMethod and GenericNativeMethod 2021-05-06 10:54:33 -07:00
Adrian Wielgosik 46ddb9be82 avm2: Generate class traits from const arrays 2021-05-06 10:54:33 -07:00
Adrian Wielgosik 8312243f42 avm2: Don't repeatedly call class.write(mc) 2021-05-06 10:54:33 -07:00
Mike Welsh b82391726f avm1: MovieClip.getBytesLoaded/Total should return the clip's length
MovieClip.getBytesLoaded and getBytesTotal return the size of that
specific clip, even if it's not a loaded SWF.  The previous logic
only returned the size of the parent SWF.

If the clip is an SWF, the uncompressed size of the SWF is returned.
Otherwise, the length of the tag list inside the clip's DefineSprite
tag is returned.
2021-05-04 16:36:56 -07:00
Aaron Hill 08d0829177 Move all SWF tests out of `core` to new `tests` package
This allows `regressions_tests.rs` to depend on other crates in the
workspace, such as `render`, without introducing a cyclic dependency.

Split out from #4054
2021-05-04 11:47:59 -07:00
Mike Welsh f9769451d6 avm1: Handle CDATA sections in XML 2021-05-03 16:23:04 -07:00
dependabot[bot] 860f26ef7d chore: Bump indicatif from 0.15.0 to 0.16.0
Bumps [indicatif](https://github.com/mitsuhiko/indicatif) from 0.15.0 to 0.16.0.
- [Release notes](https://github.com/mitsuhiko/indicatif/releases)
- [Commits](https://github.com/mitsuhiko/indicatif/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-03 15:37:40 -07:00
dependabot[bot] 185a4f5b8f chore: Bump lzma-rs from 0.1.3 to 0.2.0
Bumps [lzma-rs](https://github.com/gendx/lzma-rs) from 0.1.3 to 0.2.0.
- [Release notes](https://github.com/gendx/lzma-rs/releases)
- [Changelog](https://github.com/gendx/lzma-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gendx/lzma-rs/compare/v0.1.3...v0.2.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-03 15:37:29 -07:00
Moulins 78627acc92 chore: Move core::property_map to core::avm1::property_map 2021-05-03 13:47:14 -07:00
Moulins 272841729e core: Replace SwfMovie's PropertyMap by a list of key-value pairs
PropertyMap is an AVM1-only concept, and shouldn't be used on cross-VM
types.
2021-05-03 13:47:14 -07:00
Chris Midgley 297e4b5cae docs: note mxmlc 2021-05-03 13:16:30 -07:00
Chris Midgley 794306d6d3 docs: link mtasc, note ActionScript 2 only 2021-05-03 13:16:30 -07:00
Chris Midgley 63bed9cc51 docs: test guidelines 2021-05-03 13:16:30 -07:00
Mike Welsh dca97afdd7 chore: Remove puremp3 feature
Wasn't being used, remove the puremp3 dependency.
2021-05-02 19:31:01 -07:00
Mike Welsh 6cf8b660d5 web: Remove unwraps from Rust glue
* Remove all unwraps from web/lib.rs.
 * Add convenience methods for grabbing the Ruffle web instance.
   These methods also avoid panics/unwraps when borrowing
   `RefCell`/`Mutex`.
 * Use `warn_on_error` to avoid unwraps from web APIs.
2021-05-02 18:45:04 -07:00
Mike Welsh f2256a661b ci: Bump github-actions-deploy-aur
Hopefully fix AUR packaging because archlinux Docker image has
moved.
2021-05-02 15:29:31 -07:00
Adrian Wielgosik 8ca22c1f02
core: Support for custom context menu items on movie root 2021-05-02 15:28:00 -07:00
Chris Midgley 31911d24ab tests: replace existing shared object test using mtasc 2021-05-01 17:40:01 -07:00
Chris Midgley c03bc62074 fix: SharedObject data property is not deleteable 2021-05-01 17:40:01 -07:00
dependabot[bot] 5a4796407e chore: Bump stylelint from 13.13.0 to 13.13.1 in /web
Bumps [stylelint](https://github.com/stylelint/stylelint) from 13.13.0 to 13.13.1.
- [Release notes](https://github.com/stylelint/stylelint/releases)
- [Changelog](https://github.com/stylelint/stylelint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stylelint/stylelint/compare/13.13.0...13.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-01 15:00:23 -07:00
Chris Midgley 0f1dbb9f2a docs: note how to print trace statements 2021-05-01 13:02:31 -07:00
dependabot[bot] d8b144e972 chore: Bump @wdio/sync from 7.5.2 to 7.5.3 in /web
Bumps [@wdio/sync](https://github.com/webdriverio/webdriverio) from 7.5.2 to 7.5.3.
- [Release notes](https://github.com/webdriverio/webdriverio/releases)
- [Changelog](https://github.com/webdriverio/webdriverio/blob/main/CHANGELOG.md)
- [Commits](https://github.com/webdriverio/webdriverio/compare/v7.5.2...v7.5.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-01 12:57:10 -07:00
dependabot[bot] fe5f0c28ef chore: Bump @wdio/spec-reporter from 7.5.2 to 7.5.3 in /web
Bumps [@wdio/spec-reporter](https://github.com/webdriverio/webdriverio) from 7.5.2 to 7.5.3.
- [Release notes](https://github.com/webdriverio/webdriverio/releases)
- [Changelog](https://github.com/webdriverio/webdriverio/blob/main/CHANGELOG.md)
- [Commits](https://github.com/webdriverio/webdriverio/compare/v7.5.2...v7.5.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-01 12:57:04 -07:00