From b1f717cb7f22247249b1b41e052e651e57f93cf0 Mon Sep 17 00:00:00 2001
From: Chris Jones <jones.chris.g@gmail.com>
Date: Tue, 5 Jul 2011 18:46:08 -0400
Subject: [PATCH] get shavian-load test working

---
 crypto.js | 4 ++--
 pdf.js    | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

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();