diff --git a/crypto.js b/crypto.js index e888d0212..d73408ad6 100644 --- a/crypto.js +++ b/crypto.js @@ -139,9 +139,9 @@ var CipherTransform = (function() { }, decryptString: function(s) { var cipher = new this.stringCipherConstructor(); - var data = string2bytes(s); + var data = stringToBytes(s); data = cipher.encryptBlock(data); - return bytes2string(data); + return bytesToString(data); } }; return constructor; diff --git a/pdf.js b/pdf.js index f7a3359de..a9f0ee935 100644 --- a/pdf.js +++ b/pdf.js @@ -3566,6 +3566,7 @@ var CanvasGraphics = (function() { }, execute: function(code, xref, resources) { + resources = xref.fetchIfRef(resources) || new Dict(); var savedXref = this.xref, savedRes = this.res, savedXobjs = this.xobjs; this.xref = xref; this.res = resources || new Dict();