From 141ecfa61ff1d92e5b27d2e2eff451179c36ff9e Mon Sep 17 00:00:00 2001 From: fkaelberer Date: Mon, 20 Oct 2014 23:53:40 +0200 Subject: [PATCH 1/2] fix "JPX Out of Packets" Error (issues 4358, 4659, 4814) --- src/core/jpx.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/jpx.js b/src/core/jpx.js index b31610266..3c6a210b6 100644 --- a/src/core/jpx.js +++ b/src/core/jpx.js @@ -540,6 +540,11 @@ var JpxImage = (function JpxImageClosure() { codeblock.precinctNumber = precinctNumber; codeblock.subbandType = subband.type; codeblock.Lblock = 3; + + if (codeblock.tbx1_ <= codeblock.tbx0_ || + codeblock.tby1_ <= codeblock.tby0_) { + continue; + } codeblocks.push(codeblock); // building precinct for the sub-band var precinct = precincts[precinctNumber]; From 6337a430b33944edc034d79e251d3008888818ba Mon Sep 17 00:00:00 2001 From: fkaelberer Date: Wed, 22 Oct 2014 10:40:50 +0200 Subject: [PATCH 2/2] Add test case for JPX "Out of packets" error --- test/pdfs/bug865858.pdf.link | 1 + test/test_manifest.json | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 test/pdfs/bug865858.pdf.link diff --git a/test/pdfs/bug865858.pdf.link b/test/pdfs/bug865858.pdf.link new file mode 100644 index 000000000..45b946434 --- /dev/null +++ b/test/pdfs/bug865858.pdf.link @@ -0,0 +1 @@ +https://bug865858.bugzilla.mozilla.org/attachment.cgi?id=742273 diff --git a/test/test_manifest.json b/test/test_manifest.json index 5032a01a6..89f83ec93 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -1675,6 +1675,14 @@ "type": "eq", "about": "JPX with 0xFF55 marker" }, + { "id": "bug865858", + "file": "pdfs/bug865858.pdf", + "md5": "7a81bd987dc1d95e9a0be46b7c3f2e18", + "link": true, + "rounds": 1, + "type": "eq", + "about": "JPX packets" + }, { "id": "bug766138", "file": "pdfs/bug766138.pdf", "md5": "b171f5cf8d9834348112fba60ee54f8c",