Index: src/java/org/apache/poi/poifs/property/NPropertyTable.java =================================================================== --- src/java/org/apache/poi/poifs/property/NPropertyTable.java (revision 1229559) +++ src/java/org/apache/poi/poifs/property/NPropertyTable.java (working copy) @@ -89,7 +89,15 @@ bb.array().length == bigBlockSize.getBigBlockSize()) { data = bb.array(); } else { - data = new byte[bigBlockSize.getBigBlockSize()]; + /* + * This was originally bigBlockSize.getBigBlockSize(). + * A user reported a file, where the buffer would contain less + * bytes. The file was corrupted, yet this hack allowed it + * to be processed correctly. + */ + int dataSize = bigBlockSize.getBigBlockSize() <= bb.remaining() ? + bigBlockSize.getBigBlockSize() : bb.remaining(); + data = new byte[dataSize]; bb.get(data, 0, data.length); }