fix crash when trying to generate icon for files <84 bytes

This commit is contained in:
Jesús A. Álvarez 2016-06-06 20:47:25 +02:00
parent 76b82d92fc
commit 20a99c5a88
1 changed files with 3 additions and 0 deletions

View File

@ -138,6 +138,9 @@ static uint8_t maskReplacement[][128] = {
[fh seekToFileOffset:1024];
NSData *checkHeader = [fh readDataOfLength:128];
[fh closeFile];
if (checkHeader == nil || checkHeader.length != 128) {
return nil;
}
const unsigned char *chb = [checkHeader bytes];
// determine type from header