Skip to content

Commit 4d3dfe2

Browse files
Merge pull request #16396 from Snuffleupagus/issue-16395
Improve handling of JPEG images with non-standard /Decode-entries (issue 16395)
2 parents 3aa96e0 + 722e591 commit 4d3dfe2

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

src/core/image.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,12 @@ class PDFImage {
746746
}
747747
return imgData;
748748
}
749-
if (this.image instanceof JpegStream && !this.smask && !this.mask) {
749+
if (
750+
this.image instanceof JpegStream &&
751+
!this.smask &&
752+
!this.mask &&
753+
!this.needsDecode
754+
) {
750755
let imageLength = originalHeight * rowBytes;
751756
if (isOffscreenCanvasSupported && !mustBeResized) {
752757
let isHandled = false;

test/pdfs/issue16395.pdf.link

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://github.com/mozilla/pdf.js/files/11412207/issue16395.pdf

test/test_manifest.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@
4141
"lastPage": 2,
4242
"type": "eq"
4343
},
44+
{ "id": "issue16395",
45+
"file": "pdfs/issue16395.pdf",
46+
"md5": "a5de985711ec27cd2a2ed97d5f1c536c",
47+
"rounds": 1,
48+
"link": true,
49+
"firstPage": 3,
50+
"lastPage": 3,
51+
"type": "eq"
52+
},
4453
{ "id": "tracemonkey-fbf",
4554
"file": "pdfs/tracemonkey.pdf",
4655
"md5": "9a192d8b1a7dc652a19835f6f08098bd",

0 commit comments

Comments
 (0)