diff --git a/src/marble_engine.rs b/src/marble_engine.rs index 9a4ce86..3e439a7 100644 --- a/src/marble_engine.rs +++ b/src/marble_engine.rs @@ -63,6 +63,7 @@ impl Machine { } pub fn set_input(&mut self, bytes: Vec) { + self.input_index = self.input_index.min(bytes.len()); self.input = bytes; }