1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-23 16:48:08 +02:00

Allow StreamsSequenceStream to skip sub-streams that are not actual Streams (issue 18973)

This extends PR 13796 to also handle the case where sub-streams contain invalid data, i.e. anything that isn't a Stream, however please note that in these cases there's no guarantee that we'll render the page "correctly".

Note that Adobe Reader, i.e. the PDF reference implementation, cannot render the last page of the referenced PDF document.
This commit is contained in:
Jonas Jenwald 2024-10-29 08:52:14 +01:00
parent 93961e2802
commit 48a18585f2
3 changed files with 12 additions and 0 deletions

View file

@ -132,6 +132,8 @@ class DecodeStream extends BaseStream {
class StreamsSequenceStream extends DecodeStream {
constructor(streams, onError = null) {
streams = streams.filter(s => s instanceof BaseStream);
let maybeLength = 0;
for (const stream of streams) {
maybeLength +=