jdm / libmzx

A Rust library for loading and manipulating MegaZeux worlds.
MIT License
2 stars 0 forks source link

Panic loading world with string #47

Open jdm opened 4 years ago

jdm commented 4 years ago

https://www.digitalmzx.com/show.php?id=1665

     Running `target/debug/capture image.png output.json unzipped/Pretentia/backup3.mzx`
thread 'main' panicked at 'range end index 27750 out of range for slice of length 313', /Users/jdm/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/slice/mod.rs:1151:11
stack backtrace:
   0: rust_begin_unwind
             at /rustc/81dc88f88f92ba8ad7465f9cba10c12d3a7b70f1/library/std/src/panicking.rs:475
   1: core::panicking::panic_fmt
             at /rustc/81dc88f88f92ba8ad7465f9cba10c12d3a7b70f1/library/core/src/panicking.rs:85
   2: core::slice::slice_end_index_len_fail
             at /rustc/81dc88f88f92ba8ad7465f9cba10c12d3a7b70f1/library/core/src/slice/mod.rs:3152
   3: <core::ops::range::Range<usize> as core::slice::SliceIndex<[T]>>::index
             at /Users/jdm/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/slice/mod.rs:3341
   4: <core::ops::range::RangeTo<usize> as core::slice::SliceIndex<[T]>>::index
             at /Users/jdm/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/slice/mod.rs:3387
   5: core::slice::<impl core::ops::index::Index<I> for [T]>::index
             at /Users/jdm/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/slice/mod.rs:3126
   6: core::slice::<impl [T]>::split_at
             at /Users/jdm/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/slice/mod.rs:1151
   7: libmzx::get_string_with_length
             at /Users/jdm/src/libmzx/src/lib.rs:1831
   8: libmzx::get_string_with_preceding_length
             at /Users/jdm/src/libmzx/src/lib.rs:1827
   9: libmzx::load_board
             at /Users/jdm/src/libmzx/src/lib.rs:2063
  10: libmzx::load_world
             at /Users/jdm/src/libmzx/src/lib.rs:2449
  11: capture::run
             at ./capture/src/main.rs:63
  12: capture::main
             at ./capture/src/main.rs:220
  13: core::ops::function::FnOnce::call_once
             at /Users/jdm/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:233
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.