From 564ae6e4f74da8c99d616ed5129576adbd21db59 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 17 Nov 2013 01:51:34 +0100 Subject: [PATCH] Prevent updating the current transformation matrix when the stateStack is empty --- src/core/evaluator.js | 7 +++++-- test/pdfs/issue3925.pdf.link | 1 + test/test_manifest.json | 9 +++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 test/pdfs/issue3925.pdf.link diff --git a/src/core/evaluator.js b/src/core/evaluator.js index bf1679880..01944ed9e 100644 --- a/src/core/evaluator.js +++ b/src/core/evaluator.js @@ -1580,8 +1580,11 @@ var TextState = (function TextStateClosure() { push: function TextState_push() { this.stateStack.push(this.ctm.slice()); }, - pop: function TextStae_pop() { - this.ctm = this.stateStack.pop(); + pop: function TextState_pop() { + var prev = this.stateStack.pop(); + if (prev) { + this.ctm = prev; + } }, initialiseTextObj: function TextState_initialiseTextObj() { var m = this.textMatrix; diff --git a/test/pdfs/issue3925.pdf.link b/test/pdfs/issue3925.pdf.link new file mode 100644 index 000000000..836e0939a --- /dev/null +++ b/test/pdfs/issue3925.pdf.link @@ -0,0 +1 @@ +http://patentimages.storage.googleapis.com/pdfs/US4441207.pdf diff --git a/test/test_manifest.json b/test/test_manifest.json index 1cad8bfcd..5ba787d88 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -23,6 +23,15 @@ "rounds": 1, "type": "text" }, + { "id": "issue3925", + "file": "pdfs/issue3925.pdf", + "md5": "c5c895deecf7a7565393587e0d61be2b", + "rounds": 1, + "link": true, + "firstPage": 1, + "lastPage": 1, + "type": "text" + }, { "id": "issue1293", "file": "pdfs/issue1293.pdf", "md5": "0a744b3bbf2fd8da0131fd3c01dd1e30",