diff --git a/src/core/jpx.js b/src/core/jpx.js index 8821ce60e31e2..ec4f32d649be4 100644 --- a/src/core/jpx.js +++ b/src/core/jpx.js @@ -1125,6 +1125,11 @@ var JpxImage = (function JpxImageClosure() { zeroBitPlanesTree = new TagTree(width, height); precinct.inclusionTree = inclusionTree; precinct.zeroBitPlanesTree = zeroBitPlanesTree; + for (var l=0; l < layerNumber; l++) { + if (readBits(1) !== 0) { + throw new Error('JPX Error: Invalid tag tree'); + } + } } if (inclusionTree.reset(codeblockColumn, codeblockRow, layerNumber)) {