Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Don't lose references when deserializing subsequent AMF3 elements in AMF0 deserialization #66

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

mx4242
Copy link
Contributor

@mx4242 mx4242 commented Aug 24, 2024

When AMF0 deserialization occurs a AMF3 Element Marker (0x11), it should save the references after deserialization and pass them to the deserializer when a subsequent AMF3 element is read. This PR implements this functionality.

An easier way to do this would be to: initialize the AMF3 Decoder, and add it as a property to AMF0 Decoder, then use it when a AMF3 element has been encountered, but since AMF3 can be switched on and off in the config, I had to think about an workaround.

Probably the same thing happens with writer, but since it doesn't break anything if not implemented properly we can ignore it, but I guess when implemented properly AMF3 with repeating elements wouldn't take as much space

…3 values

fix: wrong location for AMF3References

Revert "fix: wrong location for AMF3References"

This reverts commit b4013c2.

Revert "fix: loosing references when AMF0 tries to deserialize subsequent AMF3 values"

This reverts commit 509b24b.

feat: create amf3 deserializer at start, then use the same one
Copy link
Collaborator

@CUB3D CUB3D left a comment

Choose a reason for hiding this comment

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

LGTM, would be nice to have a test for these cross-element references but not a blocker

@torokati44 torokati44 changed the title fix: Don't loose references when deserializing subsequent AMF3 elements in AMF0 deserialization. fix: Don't lose references when deserializing subsequent AMF3 elements in AMF0 deserialization. Sep 4, 2024
@torokati44 torokati44 changed the title fix: Don't lose references when deserializing subsequent AMF3 elements in AMF0 deserialization. fix: Don't lose references when deserializing subsequent AMF3 elements in AMF0 deserialization Sep 4, 2024
@torokati44 torokati44 merged commit 98679aa into ruffle-rs:master Sep 4, 2024
1 check passed
@torokati44
Copy link
Member

Thank you!

torokati44 added a commit to torokati44/ruffle that referenced this pull request Sep 4, 2024
torokati44 added a commit to torokati44/ruffle that referenced this pull request Sep 5, 2024
torokati44 added a commit to ruffle-rs/ruffle that referenced this pull request Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants