View | Details | Raw Unified | Return to bug 52446
Collapse All | Expand All

(-)src/java/org/apache/poi/poifs/property/NPropertyTable.java (-1 / +9 lines)
Lines 89-95 Link Here
89
                bb.array().length == bigBlockSize.getBigBlockSize()) {
89
                bb.array().length == bigBlockSize.getBigBlockSize()) {
90
             data = bb.array();
90
             data = bb.array();
91
          } else {
91
          } else {
92
             data = new byte[bigBlockSize.getBigBlockSize()];
92
             /*
93
              * This was originally bigBlockSize.getBigBlockSize(). 
94
              * A user reported a file, where the buffer would contain less
95
              * bytes. The file was corrupted, yet this hack allowed it
96
              * to be processed correctly. 
97
              */
98
             int dataSize = bigBlockSize.getBigBlockSize() <= bb.remaining() ?
99
                bigBlockSize.getBigBlockSize() : bb.remaining();
100
             data = new byte[dataSize];
93
             bb.get(data, 0, data.length);
101
             bb.get(data, 0, data.length);
94
          }
102
          }
95
          
103
          

Return to bug 52446