Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index out of bounds when windowsize set to 32768 #39

Open
kyle-mccarthy opened this issue Apr 17, 2019 · 0 comments
Open

Index out of bounds when windowsize set to 32768 #39

kyle-mccarthy opened this issue Apr 17, 2019 · 0 comments

Comments

@kyle-mccarthy
Copy link

I was trying to recreate the example_optimize_png in rust from the lodepng lib, but when setting my windowsize to 32768 on the encoders zlibsettings it panics with an index out of bounds error.

rustc 1.34.0 (91856ed52 2019-04-10)
macos 10.14.4

thread 'main' panicked at 'index out of bounds: the len is 30 but the index is 30'

stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:70
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:58
             at src/libstd/panicking.rs:200
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:215
   4: <std::panicking::begin_panic::PanicPayload<A> as core::panic::BoxMeUp>::get
             at src/libstd/panicking.rs:478
   5: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:385
   6: std::panicking::try::do_call
             at src/libstd/panicking.rs:312
   7: <T as core::any::Any>::type_id
             at src/libcore/panicking.rs:85
   8: <T as core::any::Any>::type_id
             at src/libcore/panicking.rs:61
   9: lodepng::rustimpl::search_code_index
             at /.../lodepng-2.4.2/src/rustimpl.rs:2105
  10: lodepng::rustimpl::add_length_distance
             at /.../lodepng-2.4.2/src/rustimpl.rs:2121
  11: lodepng::rustimpl::encode_lz77
             at /.../lodepng-2.4.2/src/rustimpl.rs:3819
  12: lodepng::rustimpl::deflate_dynamic
             at /.../lodepng-2.4.2/src/rustimpl.rs:2278
  13: lodepng::rustimpl::lodepng_deflatev
             at /.../lodepng-2.4.2/src/rustimpl.rs:2521
  14: lodepng::rustimpl::deflate
             at /.../lodepng-2.4.2/src/rustimpl.rs:2536
  15: lodepng::rustimpl::lodepng_zlib_compress
             at /.../lodepng-2.4.2/src/rustimpl.rs:2628
  16: lodepng::rustimpl::zlib_compress
             at /.../lodepng-2.4.2/src/rustimpl.rs:2646
  17: lodepng::rustimpl::add_chunk_idat
             at /.../lodepng-2.4.2/src/rustimpl.rs:1321
  18: lodepng::rustimpl::add_unknown_chunks
             at /.../lodepng-2.4.2/src/rustimpl.rs:3350
  19: lodepng::<impl lodepng::ffi::State>::encode
             at /.../lodepng-2.4.2/src/lib.rs:729
  20: lodepng::<impl lodepng::ffi::State>::encode_file
             at /.../lodepng-2.4.2/src/lib.rs:733
  21: kompres::main
             at src/main.rs:64
  22: std::rt::lang_start::{{closure}}
             at /rustc/.../src/libstd/rt.rs:64
  23: std::panicking::try::do_call
             at src/libstd/rt.rs:49
             at src/libstd/panicking.rs:297
  24: panic_unwind::dwarf::eh::read_encoded_pointer
             at src/libpanic_unwind/lib.rs:87
  25: <std::panicking::begin_panic::PanicPayload<A> as core::panic::BoxMeUp>::get
             at src/libstd/panicking.rs:276
             at src/libstd/panic.rs:388
             at src/libstd/rt.rs:48
  26: std::rt::lang_start
             at /rustc/../src/libstd/rt.rs:64
  27: png_compress::main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant