Skip to content

Commit

Permalink
avm2: Always serialize as ECMAArray, which produces an AMF0 MixedArray
Browse files Browse the repository at this point in the history
  • Loading branch information
evilpie committed Feb 19, 2024
1 parent c234c72 commit ba7c9a4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ serde = { version = "1.0.196", features = ["derive"] }
serde_json = { version = "1.0", features = ["preserve_order"] }
nellymoser-rs = { git = "https://github.com/ruffle-rs/nellymoser", rev = "4a33521c29a918950df8ae9fe07e527ac65553f5", optional = true }
regress = "0.8"
flash-lso = { git = "https://github.com/ruffle-rs/rust-flash-lso", rev = "2f976fb15b30aa4c5cb398710dc5e31a21004e57" }
flash-lso = { git = "https://github.com/ruffle-rs/rust-flash-lso", rev = "2f770555ea49c6db49c57c1dd46c7cc686e8dacc" }
lzma-rs = {version = "0.3.0", optional = true }
dasp = { version = "0.11.0", features = ["interpolate", "interpolate-linear", "signal"], optional = true }
symphonia = { version = "0.5.3", default-features = false, features = ["mp3"], optional = true }
Expand Down
8 changes: 2 additions & 6 deletions core/src/avm2/amf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,8 @@ pub fn serialize_value<'gc>(
}
}

if sparse.is_empty() {
Some(AmfValue::StrictArray(dense))
} else {
let len = sparse.len() as u32;
Some(AmfValue::ECMAArray(dense, sparse, len))
}
let len = o.as_array_storage().unwrap().length() as u32;
Some(AmfValue::ECMAArray(dense, sparse, len))
} else if let Some(vec) = o.as_vector_storage() {
let val_type = vec.value_type();
if val_type == Some(activation.avm2().classes().int) {
Expand Down
3 changes: 1 addition & 2 deletions tests/tests/swfs/from_shumway/encoding_1/test.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
num_frames = 1
known_failure = true
num_frames = 1

0 comments on commit ba7c9a4

Please sign in to comment.