Commit Graph

3038 Commits

Author SHA1 Message Date
TÖRÖK Attila 1674c95487 Fix a typo in a comment introduced in #5021 2021-08-22 11:45:33 +03:00
relrelb 1e7bdaa226 chore: Minor improvement 2021-08-22 01:03:10 +03:00
Tomasz Konojacki a3747ade5e core: fix integer overflow in ADPCM decoder
The maximum possible value of delta is 63483, so it needs to be
declared as u16.

Fixes #5030
2021-08-22 01:03:10 +03:00
David Wendt 57fffbe699 video: Use the new `H263State.parse_picture` convenience method 2021-08-21 14:13:55 -06:00
Mike Welsh 1f951b6b9f core: Add h263 feature 2021-08-21 14:13:55 -06:00
Mike Welsh a05f81b393 video: Add VideoDecoder trait
Change VideoStream to use a VideoDecoder trait instead of an enum.
This will make it a little easier as more codecs are added, and
allow us to easily enable/disable codecs behind features.
2021-08-21 14:13:55 -06:00
David Wendt 48fa03b87d video: Reuse the same bitmap whenever possible 2021-08-21 14:13:55 -06:00
David Wendt 05692cee67 video: Allow pictures with half-pixels in chroma by widening the chroma buffers to the next pixel in that direction. 2021-08-21 14:13:55 -06:00
David Wendt 43f76de602 video: Move software decoding into core now that we don't need to specialize per-renderer 2021-08-21 14:13:55 -06:00
David Wendt 885805f887 core: Half-implement an H.263 decoder 2021-08-21 14:13:55 -06:00
Tal Hayon 7b9049cedf core: Add DefineBinaryData and SymbolClass connection (Part of #1368) 2021-08-21 12:24:46 -06:00
relrelb 41142d940c avm1: Turn `TObject::call_setter` to `TObject::setter`
Remove the unused `value` parameter and rename the function to clarify
its meaning.
2021-08-21 17:23:15 +03:00
relrelb fd0e76020f avm1: Allow stored and virtual properties to co-exist
Currently properties added using `addProperty` overwrite existing
stored properties. However, there are some cases where the original
stored value can still be retrieved, which indicates that Flash
Player doesn't overwrite these properties internally.

As a solution, unify `Property::Stored` and `Property::Virtual` to
a single struct. This allows to simultaneously store regular data
and getter/setter on the same property. It also simplifies some
logic in `ScriptObject`.
2021-08-21 17:23:15 +03:00
TÖRÖK Attila a1311443a6 avm1/bitmap: Replace BitmapData.color_transform() argument with AVM-agnostic ColorTransformParams 2021-08-20 21:29:54 -06:00
TÖRÖK Attila b31ad28960 avm1: Make add_field_accessors! accept nested field names 2021-08-20 21:29:54 -06:00
TÖRÖK Attila 57ccb714c6 core,avm1: Extract ColorTransformParams from ColorTransformData 2021-08-20 21:29:54 -06:00
TÖRÖK Attila 2048bb9887 core,avm1: Move BitmapData implementation into core::bitmap from core::avm1::object
This enables exposing it to AVM2 as well in the future.
2021-08-20 21:29:54 -06:00
Ray Redondo 27e06af003
avm2: Initial MouseEvent stubs (#5065)
* avm2: Start MouseEvent stubs

* avm2: More MouseEvent work

* chore: clippy

* chore: fmt

Co-authored-by: Adrian Wielgosik <adrian.wielgosik@gmail.com>
2021-08-21 01:26:34 +02:00
Chris Midgley 58c907e985
avm2: implement string.split for undefined (#5064)
* avm2: implement string.split for undefined

* chore: cargo fmt

* dev: avoid explicit ArrayStorage
2021-08-18 18:02:41 +02:00
relrelb da7cd453cf chore: Fix png update 2021-08-18 09:01:21 +03:00
dependabot[bot] 0e408052b1 chore: Bump png from 0.16.8 to 0.17.0
Bumps [png](https://github.com/image-rs/image-png) from 0.16.8 to 0.17.0.
- [Release notes](https://github.com/image-rs/image-png/releases)
- [Changelog](https://github.com/image-rs/image-png/blob/master/CHANGES.md)
- [Commits](https://github.com/image-rs/image-png/commits)

---
updated-dependencies:
- dependency-name: png
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-18 09:01:21 +03:00
relrelb ac3c198bda chore: Appease clippy 2021-08-18 08:01:57 +03:00
dependabot[bot] b8a9e28acb chore: Bump bitstream-io from 1.1.0 to 1.2.0
Bumps [bitstream-io](https://github.com/tuffy/bitstream-io) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/tuffy/bitstream-io/releases)
- [Commits](https://github.com/tuffy/bitstream-io/compare/v1.1.0...v1.2.0)

---
updated-dependencies:
- dependency-name: bitstream-io
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-17 08:24:29 +03:00
dependabot[bot] a317a09d17 chore: Bump bitflags from 1.2.1 to 1.3.2
Bumps [bitflags](https://github.com/bitflags/bitflags) from 1.2.1 to 1.3.2.
- [Release notes](https://github.com/bitflags/bitflags/releases)
- [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bitflags/bitflags/compare/1.2.1...1.3.2)

---
updated-dependencies:
- dependency-name: bitflags
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-16 23:41:06 +03:00
Adrian Wielgosik f4da77c400 Use a more idiomatic pattern for unwrap-or-default 2021-08-15 21:55:49 +02:00
David Wendt f37a06241a chore: Clippy compliance with latest nightly compiler 2021-08-14 19:51:24 -06:00
Ray Redondo cfb2bb99d6 chore: appease clippy 2021-08-14 00:52:38 +02:00
Ray Redondo 638eaf4a55 avm2: Rename function, add runtime warnings 2021-08-14 00:52:38 +02:00
Ray Redondo 171a41b908 avm2: Add define_public_builtin_class_traits and repair Capabilities to use it 2021-08-14 00:52:38 +02:00
Ray Redondo c43f57e5f5 avm2: Implement `String.split` 2021-08-14 00:52:38 +02:00
Ray Redondo 22c6f7321e avm2: start flash.system.Capabilities stubs 2021-08-14 00:52:38 +02:00
Tal Hayon 332f1d47bb core: Reset mouse visible when loading movie to root (Fixes #4358) 2021-08-11 23:18:57 +02:00
David Wendt 84f17d1222 chore: Update `flash-lso`'s dependent commit ID 2021-08-09 18:47:03 -06:00
relrelb d40cf5aee4 avm1: Log internal error on `InvalidSwf`
This gives more percise error logs that ease finding their root
cause. Also remove `is_halting` and express it inline instead.
2021-08-03 14:40:59 -07:00
Tal Hayon 6762675bb5 core: Fixes several text edit font and bullet issues (parts of #1167) 2021-08-03 13:08:06 -07:00
dependabot[bot] 36e96b7272 chore: Bump serde from 1.0.126 to 1.0.127
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.126 to 1.0.127.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.126...v1.0.127)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-03 10:18:58 +03:00
Adrian Wielgosik b940e7f00f Extension: Sidestep CORS issues by offering to load the SWF in a tab 2021-08-02 21:28:16 +02:00
relrelb 141f886cdd avm1: Remove `TObject::set_proto`
The last usage of it was in `Player`, which anyway should operate
only on newly created objects that don't have any virtual properties
nor watchers. So it is safe to replace with `define_value`, that
also cannot fail.
2021-07-30 17:42:42 -07:00
relrelb fd3f9f34de avm1: Store `__proto__` as a regular property
`__proto__` seems to behave much like a regular data property. So
simply remove the `prototype` field of `ScriptObject` in favor of
storing the prototype in the general properties hash map.
2021-07-30 17:42:42 -07:00
relrelb 6b91239e28 avm1: Don't rely on prototypes during serialization
Instead, rely on the `TObject::as_*` methods to tell what kind the
serialized object is.
2021-07-24 04:12:34 -07:00
relrelb 06fce44665 avm1: Fix performance regression in `BitmapData::pixels_rgba`
It was regressed in #4822 when changed to use `flat_map`. But
currently Rust emits suboptimal code for such case. For now use
`Vec::with_capacity` manually to avoid unnecessary re-allocations.
2021-07-24 03:28:35 -07:00
EmperorBale 1dee1e4166 avm2: Implement flash.crypto.generateRandomBytes 2021-07-21 18:09:21 +02:00
David Wendt db86ca84b9 avm2: `get_property` does not mutate the underlying object (anymore) so it should not be flagged as mutably borrowing it. 2021-07-20 22:14:05 -04:00
David Wendt c30014baed avm2: Remove `ScriptObjectClass` and replace with separately implemented methods on `ClassObject` 2021-07-20 22:12:33 -04:00
David Wendt 4d89341e19 avm2: Cache the instance allocator on class objects 2021-07-20 22:12:33 -04:00
David Wendt 2c927f2b6b avm2: Make `coerce_to_type` take a class object instead of a multiname. 2021-07-20 22:12:33 -04:00
David Wendt bd2f758976 avm2: Don't call native initializers when coercing primitives into objects.
The former native initializer call was incorrect and would cause spurious coercion failures. Since existing code assumes the error fork of `coerce_to_object` means undefined or null, this was causing coercions and parameter typechecks against primitives to fail in the most general case.

Attempting to fix this by providing the primitive value as native initializer argument instead causes a stack overflow. This is because native initializer arguments still have to be typechecked, and in the most general case this means... coercing the primitive value we're already coercing into an object... into another object. This won't work.

Since primitive initializers aren't going to do anything that native coercions need to care about, I'm just removing the initializer call.
2021-07-20 22:12:32 -04:00
David Wendt 30b4c4386b avm2: Replace the `call_strict` mechanism with checking to see if free functions are unchecked. 2021-07-20 22:12:32 -04:00
David Wendt ddd73b3cd6 avm2: Supercalls should fall back to normal receiver access if there is no matching supertrait to use. 2021-07-20 22:12:31 -04:00
David Wendt e9b9d64cb6 avm2: Rename `StageObject::graphics_of` to just `graphics` 2021-07-20 22:12:30 -04:00