-
-
Notifications
You must be signed in to change notification settings - Fork 817
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
core: Fix "Failed to get Object" panics #18046
Conversation
ff75f1e
to
dc59d83
Compare
Since the act of merging ruffle-rs/rust-flash-lso#68 changed its HEAD hash (and there were some changes added to it even before the merge), I amended this branch accordingly. While at it, I also squashed a few "fixup" type commits into the original commits they fix, for cleaner commit history. I hope you don't mind, @CUB3D. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than that one note, I vote on merging this soon. It looks fairly non-problematic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (but mostly trusting you as the expert here :D)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved except for above comment
core/src/avm2/array.rs
Outdated
@@ -114,6 +114,25 @@ impl<'gc> ArrayStorage<'gc> { | |||
} | |||
} | |||
|
|||
/// Replace the existing dense storage with a new dense storage | |||
/// Does nothing if this `ArrayStorage` is sparse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is now outdated due to the added panic!
.
I'm just gonna fix this and merge.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... also squashed this last "chore" commit into the first one.
This constitues the ruffle-side changes of ruffle-rs/rust-flash-lso#67 and ruffle-rs/rust-flash-lso#68.
This fixes the following (previously would panic on load):
#17902 - loads
#17709 - loads
#13748 - loads
#10520 - loads
This prevents panics on the following:
#17782 - (and possible dupe #17336 )
Now errors with "Property uploadFromBitmapData not found on flash.display3D.textures.RectangleTexture and there is no default value."
#14329
Fails to load past 54%, some URL load failures might be related
#10174
Same as 17782 above
These are not fixed, but one possible underlying issue is that a new
AMF3Decoder
is created for each call toByteArray.readObject
which could result in missing references that are replaced withUndefined
when an element references a prior value in the stream. In the simple case, we could just cache theAMF3Decoder
in theByteArray
object, but this won't handle more complex cases where theByteArray
s position is changed, so I'm leaving this for future work.Update: I'm actually unsure if the above guess is true anymore, a missing change progressed the above and removed the invalid reference warnings but it still seems odd.