avm2: `playerglobal.swf` should be valid

This commit is contained in:
relrelb 2022-09-26 12:54:47 +03:00 committed by relrelb
parent 1f6368b946
commit cc531ff7db
2 changed files with 3 additions and 8 deletions

View File

@ -132,12 +132,6 @@ impl<'gc> From<String> for Error<'gc> {
}
}
impl<'gc> From<crate::tag_utils::Error> for Error<'gc> {
fn from(val: crate::tag_utils::Error) -> Error<'gc> {
Error::RustError(val.into())
}
}
impl<'gc> From<Box<dyn std::error::Error>> for Error<'gc> {
fn from(val: Box<dyn std::error::Error>) -> Error<'gc> {
Error::RustError(val)

View File

@ -656,9 +656,10 @@ fn load_playerglobal<'gc>(
activation.avm2().native_method_table = native::NATIVE_METHOD_TABLE;
activation.avm2().native_instance_allocator_table = native::NATIVE_INSTANCE_ALLOCATOR_TABLE;
let movie = Arc::new(SwfMovie::from_data(PLAYERGLOBAL, None, None)?);
let movie =
SwfMovie::from_data(PLAYERGLOBAL, None, None).expect("playerglobal.swf should be valid");
let slice = SwfSlice::from(movie);
let slice = SwfSlice::from(Arc::new(movie));
let mut reader = slice.read_from(0);