Improve handling of JPEG images without an EOI marker (issue 12841)
Given that the PDF document in the issue contains the same very large JPEG image *three* times, this patch includes a test-case where only the first page has been extracted from it.
This commit is contained in:
parent
7f199e7017
commit
cd9422a075
@ -1063,7 +1063,7 @@ var JpegImage = (function JpegImageClosure() {
|
|||||||
offset = nextFileMarker.offset;
|
offset = nextFileMarker.offset;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (offset >= data.length - 1) {
|
if (!nextFileMarker || offset >= data.length - 1) {
|
||||||
warn(
|
warn(
|
||||||
"JpegImage.parse - reached the end of the image data " +
|
"JpegImage.parse - reached the end of the image data " +
|
||||||
"without finding an EOI marker (0xFFD9)."
|
"without finding an EOI marker (0xFFD9)."
|
||||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -241,6 +241,7 @@
|
|||||||
!personwithdog.pdf
|
!personwithdog.pdf
|
||||||
!helloworld-bad.pdf
|
!helloworld-bad.pdf
|
||||||
!zerowidthline.pdf
|
!zerowidthline.pdf
|
||||||
|
!issue12841_reduced.pdf
|
||||||
!bug868745.pdf
|
!bug868745.pdf
|
||||||
!mmtype1.pdf
|
!mmtype1.pdf
|
||||||
!issue4436r.pdf
|
!issue4436r.pdf
|
||||||
|
BIN
test/pdfs/issue12841_reduced.pdf
Normal file
BIN
test/pdfs/issue12841_reduced.pdf
Normal file
Binary file not shown.
@ -3236,6 +3236,12 @@
|
|||||||
"link": true,
|
"link": true,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{ "id": "issue12841",
|
||||||
|
"file": "pdfs/issue12841_reduced.pdf",
|
||||||
|
"md5": "5c645897c652853ad86b59df5fc6cce0",
|
||||||
|
"rounds": 1,
|
||||||
|
"type": "eq"
|
||||||
|
},
|
||||||
{ "id": "issue1597",
|
{ "id": "issue1597",
|
||||||
"file": "pdfs/issue1597.pdf",
|
"file": "pdfs/issue1597.pdf",
|
||||||
"md5": "a5ebef467fd6e2fc0aeb56c9eb725ae3",
|
"md5": "a5ebef467fd6e2fc0aeb56c9eb725ae3",
|
||||||
|
Loading…
Reference in New Issue
Block a user