[poppler] poppler/Form.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 14 22:49:42 UTC 2021


 poppler/Form.cc |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 557b86db954d2cbcb9665cec0ea6edb7b0da9e75
Author: Albert Astals Cid <aacid at kde.org>
Date:   Mon Jun 14 21:53:09 2021 +0200

    Form: make sure quadding has a valid value

diff --git a/poppler/Form.cc b/poppler/Form.cc
index 3e084e4c..c8194892 100644
--- a/poppler/Form.cc
+++ b/poppler/Form.cc
@@ -2362,8 +2362,12 @@ Form::Form(PDFDoc *docA, Object *acroFormA)
         defaultAppearance = obj1.getString()->copy();
 
     obj1 = acroForm->dictLookup("Q");
-    if (obj1.isInt())
-        quadding = static_cast<VariableTextQuadding>(obj1.getInt());
+    if (obj1.isInt()) {
+        const int aux = obj1.getInt();
+        if (aux == quaddingLeftJustified || aux == quaddingCentered || aux == quaddingRightJustified) {
+            quadding = static_cast<VariableTextQuadding>(aux);
+        }
+    }
 
     resDict = acroForm->dictLookup("DR");
     if (resDict.isDict()) {


More information about the poppler mailing list