Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling of JPEG images without an EOI marker (issue 12841) #12842

Merged
merged 1 commit into from
Jan 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/jpg.js
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ var JpegImage = (function JpegImageClosure() {
offset = nextFileMarker.offset;
break;
}
if (offset >= data.length - 1) {
if (!nextFileMarker || offset >= data.length - 1) {
warn(
"JpegImage.parse - reached the end of the image data " +
"without finding an EOI marker (0xFFD9)."
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@
!personwithdog.pdf
!helloworld-bad.pdf
!zerowidthline.pdf
!issue12841_reduced.pdf
!bug868745.pdf
!mmtype1.pdf
!issue4436r.pdf
Expand Down
Binary file added test/pdfs/issue12841_reduced.pdf
Binary file not shown.
6 changes: 6 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3236,6 +3236,12 @@
"link": true,
"type": "eq"
},
{ "id": "issue12841",
"file": "pdfs/issue12841_reduced.pdf",
"md5": "5c645897c652853ad86b59df5fc6cce0",
"rounds": 1,
"type": "eq"
},
{ "id": "issue1597",
"file": "pdfs/issue1597.pdf",
"md5": "a5ebef467fd6e2fc0aeb56c9eb725ae3",
Expand Down