mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #18304 from Snuffleupagus/issue-18298
Don't throw if there's not enough data to get the header in `FlateStream` (issue 18298)
This commit is contained in:
commit
e76242d4ea
3 changed files with 17 additions and 2 deletions
|
@ -296,10 +296,15 @@ class FlateStream extends DecodeStream {
|
|||
}
|
||||
|
||||
readBlock() {
|
||||
let buffer, len;
|
||||
let buffer, hdr, len;
|
||||
const str = this.str;
|
||||
// read block header
|
||||
let hdr = this.getBits(3);
|
||||
try {
|
||||
hdr = this.getBits(3);
|
||||
} catch (ex) {
|
||||
this.#endsStreamOnError(ex.message);
|
||||
return;
|
||||
}
|
||||
if (hdr & 1) {
|
||||
this.eof = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue