Tweak the heuristic that handles JPEG images with a wildly incorrect SOF (Start of Frame) scanLines
parameter (issue 15492)
This commit is contained in:
parent
784ec3978a
commit
f1b0dc6f04
@ -163,11 +163,11 @@ function decodeScan(
|
||||
// Heuristic to attempt to handle corrupt JPEG images with too
|
||||
// large `scanLines` parameter, by falling back to the currently
|
||||
// parsed number of scanLines when it's at least (approximately)
|
||||
// one order of magnitude smaller than expected (fixes
|
||||
// issue10880.pdf and issue10989.pdf).
|
||||
// one "half" order of magnitude smaller than expected (fixes
|
||||
// issue10880.pdf, issue10989.pdf, issue15492.pdf).
|
||||
if (
|
||||
maybeScanLines > 0 &&
|
||||
Math.round(frame.scanLines / maybeScanLines) >= 10
|
||||
Math.round(frame.scanLines / maybeScanLines) >= 5
|
||||
) {
|
||||
throw new DNLMarkerError(
|
||||
"Found EOI marker (0xFFD9) while parsing scan data, " +
|
||||
|
1
test/pdfs/issue15492.pdf.link
Normal file
1
test/pdfs/issue15492.pdf.link
Normal file
@ -0,0 +1 @@
|
||||
https://github.com/mozilla/pdf.js/files/9624549/EP_Kandzetovic.pdf
|
@ -5166,6 +5166,14 @@
|
||||
"lastPage": 1,
|
||||
"type": "eq"
|
||||
},
|
||||
{ "id": "issue15492",
|
||||
"file": "pdfs/issue15492.pdf",
|
||||
"md5": "968d36ef340852a4c0e6fa22ced96798",
|
||||
"rounds": 1,
|
||||
"link": true,
|
||||
"lastPage": 1,
|
||||
"type": "eq"
|
||||
},
|
||||
{ "id": "issue9650",
|
||||
"file": "pdfs/issue9650.pdf",
|
||||
"md5": "20d50bda6b1080b6d9088811299c791e",
|
||||
|
Loading…
Reference in New Issue
Block a user