Fixed ftl.dat parsing when 0-byte resources are present

This commit is contained in:
Vhati 2018-01-22 03:07:44 -05:00
parent e76b0c67bd
commit 19233266d0
3 changed files with 12 additions and 1 deletions

View file

@ -419,7 +419,7 @@ public class PkgPack extends AbstractPack {
entry.dataSize = readBigUInt();
entry.unpackedSize = readBigUInt();
if ( entry.dataSize == 0 ) { // Null entry, dat wasn't repacked.
if ( entry.dataOffset == 0 ) { // Null entry, dat wasn't repacked.
entryList.add( null );
} else {
entryList.add( entry );
@ -434,6 +434,7 @@ public class PkgPack extends AbstractPack {
for ( int i=0; i < entryCount; i++ ) {
PkgEntry entry = entryList.get( i );
if ( entry == null ) continue;
bigByteBuf.position( entry.innerPathOffset );
entry.innerPath = readNullTerminatedString( bigByteBuf );