core: Fix panic from negative array indices in SharedObject (fix #3094)
This commit is contained in:
parent
cfbb5751e8
commit
937393ce07
|
@ -134,8 +134,8 @@ fn deserialize_array<'gc>(
|
|||
|
||||
for entry in json_obj.iter() {
|
||||
let value = recursive_deserialize(entry.1.clone(), activation);
|
||||
if let Ok(i) = entry.0.parse::<i32>() {
|
||||
obj.set_array_element(i as usize, value, activation.context.gc_context);
|
||||
if let Ok(i) = entry.0.parse::<usize>() {
|
||||
obj.set_array_element(i, value, activation.context.gc_context);
|
||||
} else {
|
||||
obj.define_value(
|
||||
activation.context.gc_context,
|
||||
|
|
|
@ -1013,6 +1013,14 @@ impl Player {
|
|||
&mut self.renderer
|
||||
}
|
||||
|
||||
pub fn storage(&self) -> &Storage {
|
||||
&self.storage
|
||||
}
|
||||
|
||||
pub fn storage_mut(&mut self) -> &mut Storage {
|
||||
&mut self.storage
|
||||
}
|
||||
|
||||
pub fn destroy(self) -> Renderer {
|
||||
self.renderer
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue