diff options
author | Albert Astals Cid <aacid@kde.org> | 2022-10-19 15:51:43 +0200 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2022-10-19 15:53:23 +0200 |
commit | a4ca3a96a6b1f65b335a1ea362e6c202e46ae055 (patch) | |
tree | fa351a951630ce17136b56041153a94a8a3e7316 | |
parent | e471f8e09bf2e38df0cf5df1acecbcca70685573 (diff) |
topIdx can't be negative
Fixes crash on broken files. Issue #1303
-rw-r--r-- | poppler/Form.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/poppler/Form.cc b/poppler/Form.cc index 4dfba6dd..d33160b3 100644 --- a/poppler/Form.cc +++ b/poppler/Form.cc @@ -1845,6 +1845,10 @@ FormFieldChoice::FormFieldChoice(PDFDoc *docA, Object &&aobj, const Ref refA, Fo obj1 = dict->lookup("TI"); if (obj1.isInt()) { topIdx = obj1.getInt(); + if (topIdx < 0) { + error(errSyntaxError, -1, "FormFieldChoice:: invalid topIdx entry\n"); + topIdx = 0; + } } obj1 = Form::fieldLookup(dict, "Opt"); |