diff --git a/src/core/jpg.js b/src/core/jpg.js index c621d794c6e09..ab048e959e62f 100644 --- a/src/core/jpg.js +++ b/src/core/jpg.js @@ -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)." diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index 6e52ba6968159..f1cda2ee99237 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -241,6 +241,7 @@ !personwithdog.pdf !helloworld-bad.pdf !zerowidthline.pdf +!issue12841_reduced.pdf !bug868745.pdf !mmtype1.pdf !issue4436r.pdf diff --git a/test/pdfs/issue12841_reduced.pdf b/test/pdfs/issue12841_reduced.pdf new file mode 100644 index 0000000000000..d2e71a91a2b02 Binary files /dev/null and b/test/pdfs/issue12841_reduced.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index 8841fba2edca4..fd62a678b0af7 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -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",