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

Panic in setup_outline_page_ids() #263

Open
asdfuser opened this issue Feb 18, 2024 · 0 comments
Open

Panic in setup_outline_page_ids() #263

asdfuser opened this issue Feb 18, 2024 · 0 comments

Comments

@asdfuser
Copy link

Calling get_toc() on the following pdf causes a panic in setup_outline_page_ids:
https://www.etsi.org/deliver/etsi_ts/102000_102099/102034/01.02.01_60/ts_102034v010201p.pdf

The application panicked (crashed).                                                                                                                                                           Message:  called `Result::unwrap()` on an `Err` value: Type                                                                                                                                   
Location: /home/daniel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lopdf-0.32.0/src/toc.rs:71                                                                                                                                                                                                                                                                                      
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━                                                                                                                                            ⋮ 9 frames hidden ⋮                               
  10: core::result::Result::unwrap::h1dd6925ad870affb                                                                                                                                    
      at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1073
  11: lopdf::toc::setup_outline_page_ids::h8d4e621112de3625                                                                                                                                   
      at /home/daniel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lopdf-0.32.0/src/toc.rs:71
  12: lopdf::toc::::get_toc::h2f5fa8a1257fe404                                                                                                                
      at /home/daniel/.caThe application panicked (crashed).                                                                                                                                                           Message:  called `Result::unwrap()` on an `Err` value: Type                                                                                                                                   
Location: /home/daniel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lopdf-0.32.0/src/toc.rs:71                                                                                                                                                                                                                                                                                      
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━                                                                                                                                            ⋮ 9 frames hidden ⋮                               
rgo/registry/src/index.crates.io-6f17d22bba15001f/lopdf-0.32.0/src/toc.rs:99
  13: getsi::pdf::lopdf::get_toc::h528e8dc44864dd4d                                                                                                                                           
      at /home/daniel/scm/osmo/rust/getsi/src/pdf/lopdf.rs:7       

Opening the file in evince shows that some chapters are missing pages (4 and 4.1) in the index view.
It looks like the second unwrap in the line fails and destination.page().unwrap().as_reference() returns an error

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