Protect ourselves from taking null pointer exceptions from corrupted AppleWorks files.

This commit is contained in:
2011-09-03 20:13:49 +00:00
parent 5adb646e11
commit 0f7f950eaa
1 changed files with 1 additions and 1 deletions

View File

@ -197,7 +197,7 @@ public class AppleWorksWordProcessorFileFilter implements FileFilter {
int byte3 = AppleUtil.getUnsignedByte(fileData[offset++]);
boolean addReturn = (byte3 >= 0x80);
int length = (byte3 & 0x7f);
while (length > 0) {
while ((length > 0) && (offset < fileData.length)) {
byte ch = fileData[offset++];
length--;
if (ch < 0x20) { // special formatting character