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

thread 'main' panicked at 'Unknown part primitive in dictionary: Number(1.0)' #183

Closed
tokatoka opened this issue May 16, 2023 · 1 comment

Comments

@tokatoka
Copy link
Contributor

tokatoka commented May 16, 2023

toka@toka:~/repro$ ./target/release/repro crash-e55.pdf 
thread 'main' panicked at 'Unknown part primitive in dictionary: Number(1.0)', /home/toka/.cargo/git/checkouts/pdf-3ef1c528a9b91eec/a6e2abc/pdf/src/encoding.rs:55:34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This is the main.rs to reproduce

fn harness(file: &String) {
    if let Ok(file) = pdf::file::FileOptions::cached().open(file) {
        for idx in 0..file.num_pages() {
            let _ = file.get_page(idx);
        }
    }
}

fn main() {
    let args: Vec<String> = std::env::args().collect();

    let _ = harness(&args[1]);
}

and this is the crashing input
crash-e55.pdf

pdf/pdf/src/encoding.rs

Lines 54 to 56 in a6e2abc

}
_ => panic!("Unknown part primitive in dictionary: {:?}", part),
}

This panic is triggered

@s3bk
Copy link
Contributor

s3bk commented May 16, 2023

That is ... why would they use a real number for indexing something.

@s3bk s3bk closed this as completed in 5cca117 May 16, 2023
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