LibPDF: Tolerate page rotation being an indirect object

Needed e.g. for 0000196.pdf in 0000.zip in the pdfa dataset.
This commit is contained in:
Nico Weber 2023-10-24 23:11:53 -07:00 committed by Andreas Kling
parent 8b806183f6
commit a65d8ff2ea
Notes: sideshowbarker 2024-07-17 18:49:10 +09:00

View file

@ -260,7 +260,7 @@ PDFErrorOr<Page> Document::get_page(u32 index)
int rotate = 0;
auto maybe_rotate = TRY(get_inheritable_value(CommonNames::Rotate, raw_page_object));
if (maybe_rotate.has_value()) {
rotate = maybe_rotate.value().to_int();
rotate = TRY(resolve_to<int>(maybe_rotate.value()));
VERIFY(rotate % 90 == 0);
}