Don't throw if there's not enough data to get the header in FlateStream (issue 18298)
Following in the footsteps of PR 17340.
This commit is contained in:
parent
94cbe9ec23
commit
3fae2d71f6
@ -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;
|
||||
}
|
||||
|
||||
1
test/pdfs/issue18298.pdf.link
Normal file
1
test/pdfs/issue18298.pdf.link
Normal file
@ -0,0 +1 @@
|
||||
https://github.com/user-attachments/files/15908428/example-malformed.pdf
|
||||
@ -5438,6 +5438,15 @@
|
||||
"lastPage": 1,
|
||||
"type": "eq"
|
||||
},
|
||||
{
|
||||
"id": "issue18298",
|
||||
"file": "pdfs/issue18298.pdf",
|
||||
"md5": "30a6108220c41ec88fa92ff45924a6cb",
|
||||
"rounds": 1,
|
||||
"link": true,
|
||||
"lastPage": 1,
|
||||
"type": "eq"
|
||||
},
|
||||
{
|
||||
"id": "issue18138",
|
||||
"file": "pdfs/issue18138.pdf",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user