mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2025-01-05 07:31:08 +00:00
Protect ourselves from taking null pointer exceptions from corrupted AppleWorks files.
This commit is contained in:
parent
5adb646e11
commit
0f7f950eaa
@ -197,7 +197,7 @@ public class AppleWorksWordProcessorFileFilter implements FileFilter {
|
|||||||
int byte3 = AppleUtil.getUnsignedByte(fileData[offset++]);
|
int byte3 = AppleUtil.getUnsignedByte(fileData[offset++]);
|
||||||
boolean addReturn = (byte3 >= 0x80);
|
boolean addReturn = (byte3 >= 0x80);
|
||||||
int length = (byte3 & 0x7f);
|
int length = (byte3 & 0x7f);
|
||||||
while (length > 0) {
|
while ((length > 0) && (offset < fileData.length)) {
|
||||||
byte ch = fileData[offset++];
|
byte ch = fileData[offset++];
|
||||||
length--;
|
length--;
|
||||||
if (ch < 0x20) { // special formatting character
|
if (ch < 0x20) { // special formatting character
|
||||||
|
Loading…
Reference in New Issue
Block a user