Bläddra i källkod

LibPDF: Let parser process filters by default

This fixes a small bug from 39b2eed3f6e: That commit tried to disable
filters for the very first object read, for the case covered in
Tests/LibPDF/password-is-sup.pdf.

However, it accidentally also disabled filters by default.

Most of the time, this isn't really a difference: We call
`set_filters_enabled(true);` very early in
`DocumentParser::initialize_linearization_dict()`, which explicitly
enables filters, and `initialize_linearization_dict()` is the very
first thing called in `DocumentParser::initialize()`.

But there's an early exit in `initialize_linearization_dict()`
for if there's nothing looking like an indirect object right
after the header, and in this case we used to not enable
filtering, and would hand compressed streams to the operand parser.

(And due to a 2nd bug, we'd even do this if the header line was
followed by an empty line.)
Nico Weber 1 år sedan
förälder
incheckning
801cfd5ae3
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      Userland/Libraries/LibPDF/Parser.h

+ 1 - 1
Userland/Libraries/LibPDF/Parser.h

@@ -83,7 +83,7 @@ protected:
     WeakPtr<Document> m_document;
     Vector<Reference> m_current_reference_stack;
     bool m_enable_encryption { true };
-    bool m_enable_filters { false };
+    bool m_enable_filters { true };
 };
 
 };