diff --git a/core/src/avm1/activation.rs b/core/src/avm1/activation.rs index 130d0a952..d5ae9c196 100644 --- a/core/src/avm1/activation.rs +++ b/core/src/avm1/activation.rs @@ -22,6 +22,7 @@ use ruffle_render::bounding_box::BoundingBox; use smallvec::SmallVec; use std::borrow::Cow; use std::cell::{Ref, RefMut}; +use std::cmp::min; use std::fmt; use swf::avm1::read::Reader; use swf::avm1::types::*; @@ -2183,7 +2184,7 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> { let loaded = self .target_clip() .and_then(|dobj| dobj.as_movie_clip()) - .map(|mc| mc.frames_loaded() > action.frame) + .map(|mc| mc.frames_loaded() > min(action.frame, mc.frames_loaded() - 1)) .unwrap_or(true); if !loaded { // Note that the offset is given in # of actions, NOT in bytes. @@ -2202,7 +2203,7 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> { let loaded = self .target_clip() .and_then(|dobj| dobj.as_movie_clip()) - .map(|mc| mc.frames_loaded() > frame_num) + .map(|mc| mc.frames_loaded() > min(frame_num, mc.frames_loaded() - 1)) .unwrap_or(true); if !loaded { // Note that the offset is given in # of actions, NOT in bytes.