mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 01:58:06 +02:00
Widget annotations: do not crash if Parent
is not a dictionary
during field name construction (issue 8143)
This commit is contained in:
parent
25f772a255
commit
936d3c0698
2 changed files with 28 additions and 0 deletions
|
@ -671,6 +671,12 @@ var WidgetAnnotation = (function WidgetAnnotationClosure() {
|
|||
var loopDict = dict;
|
||||
while (loopDict.has('Parent')) {
|
||||
loopDict = loopDict.get('Parent');
|
||||
if (!isDict(loopDict)) {
|
||||
// Even though it is not allowed according to the PDF specification,
|
||||
// bad PDF generators may provide a `Parent` entry that is not a
|
||||
// dictionary, but `null` for example (issue 8143).
|
||||
break;
|
||||
}
|
||||
|
||||
if (loopDict.has('T')) {
|
||||
fieldName.unshift(stringToPDFString(loopDict.get('T')));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue