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

crash: assertion left == right failed for JPEG #236

Open
TheOneric opened this issue Sep 22, 2024 · 1 comment
Open

crash: assertion left == right failed for JPEG #236

TheOneric opened this issue Sep 22, 2024 · 1 comment

Comments

@TheOneric
Copy link

I stumbled into a crash from a failed assertion on current dev (b3b244d) while running the fuzzer a bit

thread '<unnamed>' panicked at /home/gekota/img-fuzz/zune-image/crates/zune-jpeg/src/upsampler/scalar.rs:59:5:
assertion `left == right` failed
  left: 512
 right: 256

stack backtrace:
   0: rust_begin_unwind
             at /usr/src/rustc-1.80.1/library/std/src/panicking.rs:652:5
   1: core::panicking::panic_fmt
             at /usr/src/rustc-1.80.1/library/core/src/panicking.rs:72:14
   2: core::panicking::assert_failed_inner
             at /usr/src/rustc-1.80.1/library/core/src/panicking.rs:408:17
   3: core::panicking::assert_failed
             at /usr/src/rustc-1.80.1/library/core/src/panicking.rs:363:5
   4: zune_jpeg::upsampler::scalar::upsample_vertical
   5: zune_jpeg::upsampler::scalar::upsample_hv
             at ./src/upsampler/scalar.rs:83:5
   6: zune_jpeg::worker::upsample
             at ./src/worker.rs:402:21
   7: zune_jpeg::mcu::<impl zune_jpeg::decoder::JpegDecoder<T>>::post_process
             at ./src/mcu.rs:418:17
   8: zune_jpeg::mcu::<impl zune_jpeg::decoder::JpegDecoder<T>>::decode_mcu_ycbcr_baseline
             at ./src/mcu.rs:201:13
   9: zune_jpeg::decoder::JpegDecoder<T>::decode_into
             at ./src/decoder.rs:712:13
  10: zune_jpeg::decoder::JpegDecoder<T>::decode
             at ./src/decoder.rs:209:9
  11: decode_buffer::_::__libfuzzer_sys_run
             at ./fuzz/fuzz_targets/decode_buffer.rs:9:13

Minimised test file: zune-jpeg_assertfail.jpg
Even if the file is invalid (likely, but not sure), it probably shouldn't lead to an outright, ungraceful crash.

@etemesi254
Copy link
Owner

Correct, it should not crash.

Looking into it

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

2 participants