diff --git a/src/stream.js b/src/stream.js
index f76a07b4c..d31f3d50b 100644
--- a/src/stream.js
+++ b/src/stream.js
@@ -2056,7 +2056,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
     if (this.eoblock) {
       code = this.lookBits(7);
       p = twoDimTable[code];
-      if (p[0] > 0) {
+      if (p && p[0] > 0) {
         this.eatBits(p[0]);
         return p[1];
       }