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

Multiply with overflow when checking flac file #422

Closed
qarmin opened this issue Jul 9, 2024 · 0 comments · Fixed by #423
Closed

Multiply with overflow when checking flac file #422

qarmin opened this issue Jul 9, 2024 · 0 comments · Fixed by #423
Labels
bug Something isn't working

Comments

@qarmin
Copy link

qarmin commented Jul 9, 2024

Reproducer

    let mut file = match File::open(&path) {
        Ok(t) => t,
        Err(e) => {
            println!("{e} - {path}");
            return;
        }
    };
    let tagged_file = match read_from(&mut file) {
        Ok(t) => t,
        Err(e) => {
            println!("{e}");
            return;
        }
    };

    tagged_file.properties();
    tagged_file.tags();
    tagged_file.primary_tag();

Summary

thread 'main' panicked at /home/rafal/.cargo/git/checkouts/lofty-rs-f5e48f8219b271cf/3d43b58/lofty/src/flac/read.rs:137:10:
attempt to subtract with overflow
stack backtrace:
   0: rust_begin_unwind
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:652:5
   1: core::panicking::panic_fmt
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/panicking.rs:72:14
   2: core::panicking::panic_const::panic_const_sub_overflow
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/panicking.rs:180:21
   3: lofty::flac::read::read_from
             at /home/rafal/.cargo/git/checkouts/lofty-rs-f5e48f8219b271cf/3d43b58/lofty/src/flac/read.rs:137:4
   4: <lofty::flac::FlacFile as lofty::file::audio_file::AudioFile>::read_from
             at /home/rafal/.cargo/git/checkouts/lofty-rs-f5e48f8219b271cf/3d43b58/lofty/src/flac/mod.rs:38:10
   5: lofty::probe::Probe<R>::read
             at /home/rafal/.cargo/git/checkouts/lofty-rs-f5e48f8219b271cf/3d43b58/lofty/src/probe.rs:471:23
   6: lofty::probe::read_from
             at /home/rafal/.cargo/git/checkouts/lofty-rs-f5e48f8219b271cf/3d43b58/lofty/src/probe.rs:517:2
   7: lofty::check_file
             at ./src/crates/lofty/src/main.rs:33:29
   8: lofty::main
             at ./src/crates/lofty/src/main.rs:21:9
   9: core::ops::function::FnOnce::call_once
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
timeout: the monitored command dumped core

##### Automatic Fuzzer note, output status "None", output signal "Some(6)"

Expected behavior

No response

Assets

compressed.zip

@qarmin qarmin added the bug Something isn't working label Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant