[poppler] poppler/Form.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 27 00:42:11 UTC 2020


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

New commits:
commit e9253bda14b10059c734213e3ad88b5b1f8cc546
Author: Albert Astals Cid <aacid at kde.org>
Date:   Fri Nov 27 01:36:13 2020 +0100

    Protect against invalid quadding values
    
    oss-fuzz/27915

diff --git a/poppler/Form.cc b/poppler/Form.cc
index 2ea343dd..b9a525e6 100644
--- a/poppler/Form.cc
+++ b/poppler/Form.cc
@@ -604,8 +604,11 @@ FormField::FormField(PDFDoc *docA, Object &&aobj, const Ref aref, FormField *par
 
     obj1 = Form::fieldLookup(dict, "Q");
     if (obj1.isInt()) {
-        quadding = static_cast<VariableTextQuadding>(obj1.getInt());
-        hasQuadding = true;
+        const int aux = obj1.getInt();
+        hasQuadding = aux == quaddingLeftJustified || aux == quaddingCentered || aux == quaddingRightJustified;
+        if (likely(hasQuadding)) {
+            quadding = static_cast<VariableTextQuadding>(aux);
+        }
     }
 
     obj1 = dict->lookup("T");


More information about the poppler mailing list