Commit 8df3de5c21e779c8ca75a12979859cfd28a0e83d

Authored by m-holger
1 parent 68e09577

Refine QPDFParser error handling

Reduce the container size for which a single bad token will cause a failure
from 100,000 to 5,000.

Count missing dictionary keys as errors.
libqpdf/QPDFParser.cc
... ... @@ -469,17 +469,20 @@ QPDFParser::fixMissingKeys()
469 469 bool
470 470 QPDFParser::tooManyBadTokens()
471 471 {
  472 + if (frame->olist.size() > 5'000 || frame->dict.size() > 5'000) {
  473 + warn("encountered errors while parsing an array or dictionary with more than 5000 "
  474 + "elements; giving up on reading object");
  475 + return true;
  476 + }
472 477 if (--max_bad_count > 0 && good_count > 4) {
473   - if (frame->olist.size() > 100'000 || frame->dict.size() > 100'000) {
474   - warn("encountered errors while parsing an array or dictionary with more than 100000 "
475   - "elements; giving up on reading object");
476   - return true;
477   - }
478 478 good_count = 0;
479 479 bad_count = 1;
480 480 return false;
481 481 }
482   - if (++bad_count > 5) {
  482 + if (++bad_count > 5 ||
  483 + (frame->state != st_array && QIntC::to_size(max_bad_count) < frame->olist.size())) {
  484 + // Give up after 5 errors in close proximity or if the number of missing dictionary keys
  485 + // exceeds the remaining number of allowable total errors.
483 486 warn("too many errors; giving up on reading object");
484 487 return true;
485 488 }
... ...
qpdf/qtest/qpdf/issue-335a.out
... ... @@ -49,14 +49,7 @@ WARNING: issue-335a.pdf (trailer, offset 284): unexpected )
49 49 WARNING: issue-335a.pdf (trailer, offset 285): unexpected )
50 50 WARNING: issue-335a.pdf (trailer, offset 563): unexpected )
51 51 WARNING: issue-335a.pdf (trailer, offset 596): unexpected )
52   -WARNING: issue-335a.pdf (trailer, offset 597): name with stray # will not work with PDF >= 1.2
53   -WARNING: issue-335a.pdf (trailer, offset 600): unexpected )
54   -WARNING: issue-335a.pdf (trailer, offset 134): dictionary has duplicated key /L
55   -WARNING: issue-335a.pdf (trailer, offset 601): unexpected )
56   -WARNING: issue-335a.pdf (trailer, offset 648): unexpected )
57   -WARNING: issue-335a.pdf (trailer, offset 649): name with stray # will not work with PDF >= 1.2
58   -WARNING: issue-335a.pdf (trailer, offset 652): unexpected )
59   -WARNING: issue-335a.pdf (trailer, offset 652): too many errors; giving up on reading object
  52 +WARNING: issue-335a.pdf (trailer, offset 596): too many errors; giving up on reading object
60 53 WARNING: issue-335a.pdf (trailer, offset 148): treating unexpected brace token as null
61 54 WARNING: issue-335a.pdf (trailer, offset 149): unexpected )
62 55 WARNING: issue-335a.pdf (trailer, offset 150): unexpected )
... ... @@ -73,14 +66,7 @@ WARNING: issue-335a.pdf (trailer, offset 284): unexpected )
73 66 WARNING: issue-335a.pdf (trailer, offset 285): unexpected )
74 67 WARNING: issue-335a.pdf (trailer, offset 563): unexpected )
75 68 WARNING: issue-335a.pdf (trailer, offset 596): unexpected )
76   -WARNING: issue-335a.pdf (trailer, offset 597): name with stray # will not work with PDF >= 1.2
77   -WARNING: issue-335a.pdf (trailer, offset 600): unexpected )
78   -WARNING: issue-335a.pdf (trailer, offset 164): dictionary has duplicated key /L
79   -WARNING: issue-335a.pdf (trailer, offset 601): unexpected )
80   -WARNING: issue-335a.pdf (trailer, offset 648): unexpected )
81   -WARNING: issue-335a.pdf (trailer, offset 649): name with stray # will not work with PDF >= 1.2
82   -WARNING: issue-335a.pdf (trailer, offset 652): unexpected )
83   -WARNING: issue-335a.pdf (trailer, offset 652): too many errors; giving up on reading object
  69 +WARNING: issue-335a.pdf (trailer, offset 596): too many errors; giving up on reading object
84 70 WARNING: issue-335a.pdf (trailer, offset 178): invalid character (<) in hexstring
85 71 WARNING: issue-335a.pdf (trailer, offset 212): treating unexpected brace token as null
86 72 WARNING: issue-335a.pdf (trailer, offset 213): unexpected )
... ... @@ -97,14 +83,7 @@ WARNING: issue-335a.pdf (trailer, offset 284): unexpected )
97 83 WARNING: issue-335a.pdf (trailer, offset 285): unexpected )
98 84 WARNING: issue-335a.pdf (trailer, offset 563): unexpected )
99 85 WARNING: issue-335a.pdf (trailer, offset 596): unexpected )
100   -WARNING: issue-335a.pdf (trailer, offset 597): name with stray # will not work with PDF >= 1.2
101   -WARNING: issue-335a.pdf (trailer, offset 600): unexpected )
102   -WARNING: issue-335a.pdf (trailer, offset 231): dictionary has duplicated key /L
103   -WARNING: issue-335a.pdf (trailer, offset 601): unexpected )
104   -WARNING: issue-335a.pdf (trailer, offset 648): unexpected )
105   -WARNING: issue-335a.pdf (trailer, offset 649): name with stray # will not work with PDF >= 1.2
106   -WARNING: issue-335a.pdf (trailer, offset 652): unexpected )
107   -WARNING: issue-335a.pdf (trailer, offset 652): too many errors; giving up on reading object
  86 +WARNING: issue-335a.pdf (trailer, offset 596): too many errors; giving up on reading object
108 87 WARNING: issue-335a.pdf (trailer, offset 245): treating unexpected brace token as null
109 88 WARNING: issue-335a.pdf (trailer, offset 246): unexpected )
110 89 WARNING: issue-335a.pdf (trailer, offset 247): unexpected )
... ... @@ -135,11 +114,7 @@ WARNING: issue-335a.pdf (trailer, offset 563): unexpected )
135 114 WARNING: issue-335a.pdf (trailer, offset 596): unexpected )
136 115 WARNING: issue-335a.pdf (trailer, offset 597): name with stray # will not work with PDF >= 1.2
137 116 WARNING: issue-335a.pdf (trailer, offset 600): unexpected )
138   -WARNING: issue-335a.pdf (trailer, offset 601): unexpected )
139   -WARNING: issue-335a.pdf (trailer, offset 648): unexpected )
140   -WARNING: issue-335a.pdf (trailer, offset 649): name with stray # will not work with PDF >= 1.2
141   -WARNING: issue-335a.pdf (trailer, offset 652): unexpected )
142   -WARNING: issue-335a.pdf (trailer, offset 652): too many errors; giving up on reading object
  117 +WARNING: issue-335a.pdf (trailer, offset 600): too many errors; giving up on reading object
143 118 WARNING: issue-335a.pdf (trailer, offset 313): treating unexpected brace token as null
144 119 WARNING: issue-335a.pdf (trailer, offset 314): unexpected )
145 120 WARNING: issue-335a.pdf (trailer, offset 315): unexpected )
... ... @@ -147,22 +122,14 @@ WARNING: issue-335a.pdf (trailer, offset 563): unexpected )
147 122 WARNING: issue-335a.pdf (trailer, offset 596): unexpected )
148 123 WARNING: issue-335a.pdf (trailer, offset 597): name with stray # will not work with PDF >= 1.2
149 124 WARNING: issue-335a.pdf (trailer, offset 600): unexpected )
150   -WARNING: issue-335a.pdf (trailer, offset 601): unexpected )
151   -WARNING: issue-335a.pdf (trailer, offset 648): unexpected )
152   -WARNING: issue-335a.pdf (trailer, offset 649): name with stray # will not work with PDF >= 1.2
153   -WARNING: issue-335a.pdf (trailer, offset 652): unexpected )
154   -WARNING: issue-335a.pdf (trailer, offset 652): too many errors; giving up on reading object
  125 +WARNING: issue-335a.pdf (trailer, offset 600): too many errors; giving up on reading object
155 126 WARNING: issue-335a.pdf (trailer, offset 329): unknown token while reading object; treating as string
156 127 WARNING: issue-335a.pdf (trailer, offset 403): unexpected )
157 128 WARNING: issue-335a.pdf (trailer, offset 563): unexpected )
158 129 WARNING: issue-335a.pdf (trailer, offset 596): unexpected )
159 130 WARNING: issue-335a.pdf (trailer, offset 597): name with stray # will not work with PDF >= 1.2
160 131 WARNING: issue-335a.pdf (trailer, offset 600): unexpected )
161   -WARNING: issue-335a.pdf (trailer, offset 601): unexpected )
162   -WARNING: issue-335a.pdf (trailer, offset 648): unexpected )
163   -WARNING: issue-335a.pdf (trailer, offset 649): name with stray # will not work with PDF >= 1.2
164   -WARNING: issue-335a.pdf (trailer, offset 652): unexpected )
165   -WARNING: issue-335a.pdf (trailer, offset 652): too many errors; giving up on reading object
  132 +WARNING: issue-335a.pdf (trailer, offset 600): too many errors; giving up on reading object
166 133 WARNING: issue-335a.pdf (trailer, offset 361): unknown token while reading object; treating as string
167 134 WARNING: issue-335a.pdf (trailer, offset 379): unknown token while reading object; treating as string
168 135 WARNING: issue-335a.pdf (trailer, offset 380): unexpected )
... ... @@ -170,13 +137,7 @@ WARNING: issue-335a.pdf (trailer, offset 381): unexpected )
170 137 WARNING: issue-335a.pdf (trailer, offset 403): unexpected )
171 138 WARNING: issue-335a.pdf (trailer, offset 563): unexpected )
172 139 WARNING: issue-335a.pdf (trailer, offset 596): unexpected )
173   -WARNING: issue-335a.pdf (trailer, offset 597): name with stray # will not work with PDF >= 1.2
174   -WARNING: issue-335a.pdf (trailer, offset 600): unexpected )
175   -WARNING: issue-335a.pdf (trailer, offset 601): unexpected )
176   -WARNING: issue-335a.pdf (trailer, offset 648): unexpected )
177   -WARNING: issue-335a.pdf (trailer, offset 649): name with stray # will not work with PDF >= 1.2
178   -WARNING: issue-335a.pdf (trailer, offset 652): unexpected )
179   -WARNING: issue-335a.pdf (trailer, offset 652): too many errors; giving up on reading object
  140 +WARNING: issue-335a.pdf (trailer, offset 596): too many errors; giving up on reading object
180 141 WARNING: issue-335a.pdf (trailer, offset 377): treating unexpected brace token as null
181 142 WARNING: issue-335a.pdf (trailer, offset 378): unexpected )
182 143 WARNING: issue-335a.pdf (trailer, offset 379): unknown token while reading object; treating as string
... ... @@ -190,13 +151,7 @@ WARNING: issue-335a.pdf (trailer, offset 402): unexpected )
190 151 WARNING: issue-335a.pdf (trailer, offset 403): unexpected )
191 152 WARNING: issue-335a.pdf (trailer, offset 563): unexpected )
192 153 WARNING: issue-335a.pdf (trailer, offset 596): unexpected )
193   -WARNING: issue-335a.pdf (trailer, offset 597): name with stray # will not work with PDF >= 1.2
194   -WARNING: issue-335a.pdf (trailer, offset 600): unexpected )
195   -WARNING: issue-335a.pdf (trailer, offset 601): unexpected )
196   -WARNING: issue-335a.pdf (trailer, offset 648): unexpected )
197   -WARNING: issue-335a.pdf (trailer, offset 649): name with stray # will not work with PDF >= 1.2
198   -WARNING: issue-335a.pdf (trailer, offset 652): unexpected )
199   -WARNING: issue-335a.pdf (trailer, offset 652): too many errors; giving up on reading object
  154 +WARNING: issue-335a.pdf (trailer, offset 596): too many errors; giving up on reading object
200 155 WARNING: issue-335a.pdf (trailer, offset 417): unknown token while reading object; treating as string
201 156 WARNING: issue-335a.pdf (trailer, offset 433): unexpected )
202 157 WARNING: issue-335a.pdf (trailer, offset 563): unexpected )
... ... @@ -451,12 +406,7 @@ WARNING: issue-335a.pdf (trailer, offset 1168): unexpected )
451 406 WARNING: issue-335a.pdf (trailer, offset 1328): unexpected )
452 407 WARNING: issue-335a.pdf (trailer, offset 1329): name with stray # will not work with PDF >= 1.2
453 408 WARNING: issue-335a.pdf (trailer, offset 1332): unexpected )
454   -WARNING: issue-335a.pdf (trailer, offset 1033): dictionary has duplicated key /L
455   -WARNING: issue-335a.pdf (trailer, offset 1333): unexpected )
456   -WARNING: issue-335a.pdf (trailer, offset 1344): unexpected )
457   -WARNING: issue-335a.pdf (trailer, offset 1428): unexpected )
458   -WARNING: issue-335a.pdf (trailer, offset 1434): invalid character (#) in hexstring
459   -WARNING: issue-335a.pdf (trailer, offset 1434): too many errors; giving up on reading object
  409 +WARNING: issue-335a.pdf (trailer, offset 1332): too many errors; giving up on reading object
460 410 WARNING: issue-335a.pdf (trailer, offset 1047): treating unexpected brace token as null
461 411 WARNING: issue-335a.pdf (trailer, offset 1048): unexpected )
462 412 WARNING: issue-335a.pdf (trailer, offset 1049): unexpected )
... ... @@ -579,11 +529,7 @@ WARNING: issue-335a.pdf (trailer, offset 1713): unexpected )
579 529 WARNING: issue-335a.pdf (trailer, offset 1989): unexpected )
580 530 WARNING: issue-335a.pdf (trailer, offset 3057): unknown token while reading object; treating as string
581 531 WARNING: issue-335a.pdf (trailer, offset 3064): unknown token while reading object; treating as string
582   -WARNING: issue-335a.pdf (trailer, offset 3073): unknown token while reading object; treating as string
583   -WARNING: issue-335a.pdf (trailer, offset 3080): unknown token while reading object; treating as string
584   -WARNING: issue-335a.pdf (trailer, offset 3089): unknown token while reading object; treating as string
585   -WARNING: issue-335a.pdf (trailer, offset 3096): unknown token while reading object; treating as string
586   -WARNING: issue-335a.pdf (trailer, offset 3096): too many errors; giving up on reading object
  532 +WARNING: issue-335a.pdf (trailer, offset 3064): too many errors; giving up on reading object
587 533 WARNING: issue-335a.pdf (trailer, offset 1487): unknown token while reading object; treating as string
588 534 WARNING: issue-335a.pdf (trailer, offset 1710): invalid character (#) in hexstring
589 535 WARNING: issue-335a.pdf (trailer, offset 1712): unexpected )
... ... @@ -591,11 +537,7 @@ WARNING: issue-335a.pdf (trailer, offset 1713): unexpected )
591 537 WARNING: issue-335a.pdf (trailer, offset 1989): unexpected )
592 538 WARNING: issue-335a.pdf (trailer, offset 3057): unknown token while reading object; treating as string
593 539 WARNING: issue-335a.pdf (trailer, offset 3064): unknown token while reading object; treating as string
594   -WARNING: issue-335a.pdf (trailer, offset 3073): unknown token while reading object; treating as string
595   -WARNING: issue-335a.pdf (trailer, offset 3080): unknown token while reading object; treating as string
596   -WARNING: issue-335a.pdf (trailer, offset 3089): unknown token while reading object; treating as string
597   -WARNING: issue-335a.pdf (trailer, offset 3096): unknown token while reading object; treating as string
598   -WARNING: issue-335a.pdf (trailer, offset 3096): too many errors; giving up on reading object
  540 +WARNING: issue-335a.pdf (trailer, offset 3064): too many errors; giving up on reading object
599 541 WARNING: issue-335a.pdf (trailer, offset 1503): treating unexpected brace token as null
600 542 WARNING: issue-335a.pdf (trailer, offset 1504): unknown token while reading object; treating as string
601 543 WARNING: issue-335a.pdf (trailer, offset 1704): unexpected )
... ... @@ -680,22 +622,14 @@ WARNING: issue-335a.pdf (trailer, offset 1749): unexpected )
680 622 WARNING: issue-335a.pdf (trailer, offset 1989): unexpected )
681 623 WARNING: issue-335a.pdf (trailer, offset 3057): unknown token while reading object; treating as string
682 624 WARNING: issue-335a.pdf (trailer, offset 3064): unknown token while reading object; treating as string
683   -WARNING: issue-335a.pdf (trailer, offset 3073): unknown token while reading object; treating as string
684   -WARNING: issue-335a.pdf (trailer, offset 3080): unknown token while reading object; treating as string
685   -WARNING: issue-335a.pdf (trailer, offset 3089): unknown token while reading object; treating as string
686   -WARNING: issue-335a.pdf (trailer, offset 3096): unknown token while reading object; treating as string
687   -WARNING: issue-335a.pdf (trailer, offset 3096): too many errors; giving up on reading object
  625 +WARNING: issue-335a.pdf (trailer, offset 3064): too many errors; giving up on reading object
688 626 WARNING: issue-335a.pdf (trailer, offset 1763): unknown token while reading object; treating as string
689 627 WARNING: issue-335a.pdf (trailer, offset 1986): invalid character (#) in hexstring
690 628 WARNING: issue-335a.pdf (trailer, offset 1988): unexpected )
691 629 WARNING: issue-335a.pdf (trailer, offset 1989): unexpected )
692 630 WARNING: issue-335a.pdf (trailer, offset 3057): unknown token while reading object; treating as string
693 631 WARNING: issue-335a.pdf (trailer, offset 3064): unknown token while reading object; treating as string
694   -WARNING: issue-335a.pdf (trailer, offset 3073): unknown token while reading object; treating as string
695   -WARNING: issue-335a.pdf (trailer, offset 3080): unknown token while reading object; treating as string
696   -WARNING: issue-335a.pdf (trailer, offset 3089): unknown token while reading object; treating as string
697   -WARNING: issue-335a.pdf (trailer, offset 3096): unknown token while reading object; treating as string
698   -WARNING: issue-335a.pdf (trailer, offset 3096): too many errors; giving up on reading object
  632 +WARNING: issue-335a.pdf (trailer, offset 3064): too many errors; giving up on reading object
699 633 WARNING: issue-335a.pdf (trailer, offset 1779): treating unexpected brace token as null
700 634 WARNING: issue-335a.pdf (trailer, offset 1780): unknown token while reading object; treating as string
701 635 WARNING: issue-335a.pdf (trailer, offset 1980): unexpected )
... ... @@ -711,11 +645,7 @@ WARNING: issue-335a.pdf (trailer, offset 1988): unexpected )
711 645 WARNING: issue-335a.pdf (trailer, offset 1989): unexpected )
712 646 WARNING: issue-335a.pdf (trailer, offset 3057): unknown token while reading object; treating as string
713 647 WARNING: issue-335a.pdf (trailer, offset 3064): unknown token while reading object; treating as string
714   -WARNING: issue-335a.pdf (trailer, offset 3073): unknown token while reading object; treating as string
715   -WARNING: issue-335a.pdf (trailer, offset 3080): unknown token while reading object; treating as string
716   -WARNING: issue-335a.pdf (trailer, offset 3089): unknown token while reading object; treating as string
717   -WARNING: issue-335a.pdf (trailer, offset 3096): unknown token while reading object; treating as string
718   -WARNING: issue-335a.pdf (trailer, offset 3096): too many errors; giving up on reading object
  648 +WARNING: issue-335a.pdf (trailer, offset 3064): too many errors; giving up on reading object
719 649 WARNING: issue-335a.pdf (trailer, offset 1809): invalid character (<) in hexstring
720 650 WARNING: issue-335a.pdf (trailer, offset 1827): unknown token while reading object; treating as string
721 651 WARNING: issue-335a.pdf (trailer, offset 1845): unknown token while reading object; treating as string
... ... @@ -785,20 +715,14 @@ WARNING: issue-335a.pdf (trailer, offset 2022): unexpected )
785 715 WARNING: issue-335a.pdf (trailer, offset 3057): unknown token while reading object; treating as string
786 716 WARNING: issue-335a.pdf (trailer, offset 3064): unknown token while reading object; treating as string
787 717 WARNING: issue-335a.pdf (trailer, offset 3073): unknown token while reading object; treating as string
788   -WARNING: issue-335a.pdf (trailer, offset 3080): unknown token while reading object; treating as string
789   -WARNING: issue-335a.pdf (trailer, offset 3089): unknown token while reading object; treating as string
790   -WARNING: issue-335a.pdf (trailer, offset 3096): unknown token while reading object; treating as string
791   -WARNING: issue-335a.pdf (trailer, offset 3096): too many errors; giving up on reading object
  718 +WARNING: issue-335a.pdf (trailer, offset 3073): too many errors; giving up on reading object
792 719 WARNING: issue-335a.pdf (trailer, offset 2020): treating unexpected brace token as null
793 720 WARNING: issue-335a.pdf (trailer, offset 2021): unexpected )
794 721 WARNING: issue-335a.pdf (trailer, offset 2022): unexpected )
795 722 WARNING: issue-335a.pdf (trailer, offset 3057): unknown token while reading object; treating as string
796 723 WARNING: issue-335a.pdf (trailer, offset 3064): unknown token while reading object; treating as string
797 724 WARNING: issue-335a.pdf (trailer, offset 3073): unknown token while reading object; treating as string
798   -WARNING: issue-335a.pdf (trailer, offset 3080): unknown token while reading object; treating as string
799   -WARNING: issue-335a.pdf (trailer, offset 3089): unknown token while reading object; treating as string
800   -WARNING: issue-335a.pdf (trailer, offset 3096): unknown token while reading object; treating as string
801   -WARNING: issue-335a.pdf (trailer, offset 3096): too many errors; giving up on reading object
  725 +WARNING: issue-335a.pdf (trailer, offset 3073): too many errors; giving up on reading object
802 726 WARNING: issue-335a.pdf (trailer, offset 3585): treating unexpected brace token as null
803 727 WARNING: issue-335a.pdf (trailer, offset 3586): unknown token while reading object; treating as string
804 728 WARNING: issue-335a.pdf (trailer, offset 3588): unexpected )
... ... @@ -1003,4 +927,30 @@ WARNING: issue-335a.pdf (trailer, offset 20601): unexpected )
1003 927 WARNING: issue-335a.pdf (trailer, offset 20602): unknown token while reading object; treating as string
1004 928 WARNING: issue-335a.pdf (trailer, offset 20604): invalid character ({) in hexstring
1005 929 WARNING: issue-335a.pdf (trailer, offset 20604): too many errors; giving up on reading object
1006   -qpdf: issue-335a.pdf: too many errors while reconstructing cross-reference table
  930 +WARNING: issue-335a.pdf (trailer, offset 20446): unknown token while reading object; treating as string
  931 +WARNING: issue-335a.pdf (trailer, offset 20601): unexpected )
  932 +WARNING: issue-335a.pdf (trailer, offset 20602): unknown token while reading object; treating as string
  933 +WARNING: issue-335a.pdf (trailer, offset 20604): invalid character ({) in hexstring
  934 +WARNING: issue-335a.pdf (trailer, offset 20606): treating unexpected brace token as null
  935 +WARNING: issue-335a.pdf (trailer, offset 20607): treating unexpected brace token as null
  936 +WARNING: issue-335a.pdf (trailer, offset 20607): too many errors; giving up on reading object
  937 +WARNING: issue-335a.pdf (trailer, offset 20598): unknown token while reading object; treating as string
  938 +WARNING: issue-335a.pdf (trailer, offset 20600): unexpected )
  939 +WARNING: issue-335a.pdf (trailer, offset 20601): unexpected )
  940 +WARNING: issue-335a.pdf (trailer, offset 20602): unknown token while reading object; treating as string
  941 +WARNING: issue-335a.pdf (trailer, offset 20604): invalid character ({) in hexstring
  942 +WARNING: issue-335a.pdf (trailer, offset 20606): treating unexpected brace token as null
  943 +WARNING: issue-335a.pdf (trailer, offset 20606): too many errors; giving up on reading object
  944 +WARNING: issue-335a.pdf (trailer, offset 20684): unknown token while reading object; treating as string
  945 +WARNING: issue-335a.pdf (trailer, offset 20683): expected dictionary key but found non-name object; inserting key /QPDFFake1
  946 +WARNING: issue-335a.pdf (trailer, offset 20747): stream keyword found in trailer
  947 +WARNING: issue-335a.pdf (object 5 0, offset 23451): invalid character (ÿ) in hexstring
  948 +WARNING: issue-335a.pdf (object 5 0, offset 23458): unknown token while reading object; treating as string
  949 +WARNING: issue-335a.pdf (object 5 0, offset 23444): expected dictionary key but found non-name object; inserting key /QPDFFake1
  950 +WARNING: issue-335a.pdf (object 5 0, offset 23444): expected dictionary key but found non-name object; inserting key /QPDFFake2
  951 +WARNING: issue-335a.pdf (object 5 0, offset 23440): stream dictionary lacks /Length key
  952 +WARNING: issue-335a.pdf (object 5 0, offset 23485): attempting to recover stream length
  953 +WARNING: issue-335a.pdf (object 5 0, offset 23485): unable to recover stream data; treating stream as empty
  954 +WARNING: issue-335a.pdf (object 5 0, offset 24974): expected endobj
  955 +WARNING: issue-335a.pdf (object 5 0, offset 24974): EOF after endobj
  956 +qpdf: issue-335a.pdf: unable to find /Root dictionary
... ...