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

Ignore, rather than throwing on, Coding style component (COC) markers in JPEG 2000 images (issue 12752) #12753

Merged
merged 1 commit into from
Dec 18, 2020
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
7 changes: 3 additions & 4 deletions src/core/jpx.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,17 +392,16 @@ var JpxImage = (function JpxImageClosure() {
length = tile.dataEnd - position;
parseTilePackets(context, data, position, length);
break;
case 0xff53: // Coding style component (COC)
warn("JPX: Codestream code 0xFF53 (COC) is not implemented.");
/* falls through */
case 0xff55: // Tile-part lengths, main header (TLM)
case 0xff57: // Packet length, main header (PLM)
case 0xff58: // Packet length, tile-part header (PLT)
case 0xff64: // Comment (COM)
length = readUint16(data, position);
// skipping content
break;
case 0xff53: // Coding style component (COC)
throw new Error(
"Codestream code 0xFF53 (COC) is not implemented"
);
default:
throw new Error("Unknown codestream code: " + code.toString(16));
}
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/issue12752.pdf.link
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/mozilla/pdf.js/files/5715933/WE2330Ausweis_2.pdf
8 changes: 8 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2045,6 +2045,14 @@
"link": true,
"type": "eq"
},
{ "id": "issue12752",
"file": "pdfs/issue12752.pdf",
"md5": "9f8ada17a613d18919714baf684e165f",
"rounds": 1,
"lastPage": 1,
"link": true,
"type": "eq"
},
{ "id": "issue7872",
"file": "pdfs/issue7872.pdf",
"md5": "81781dfecfcb7e9cd9cc7e60f8b747b7",
Expand Down