1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-13 16:23:38 +02:00

Return false from unPackBinary if no tracks are valid

This commit is contained in:
leo60228 2020-07-30 17:08:27 -04:00 committed by Misa Elizabeth Kai
parent f86a67456b
commit 668c3d91d6

View File

@ -770,7 +770,7 @@ bool FILESYSTEM_loadBinaryBlob(binaryBlob* blob, const char* filename)
{
PHYSFS_sint64 size;
PHYSFS_File* handle;
int offset;
int valid, offset;
size_t i;
char path[MAX_PATH];
@ -796,6 +796,7 @@ bool FILESYSTEM_loadBinaryBlob(binaryBlob* blob, const char* filename)
sizeof(blob->m_headers)
);
valid = 0;
offset = sizeof(blob->m_headers);
for (i = 0; i < SDL_arraysize(blob->m_headers); ++i)
@ -828,15 +829,20 @@ bool FILESYSTEM_loadBinaryBlob(binaryBlob* blob, const char* filename)
}
PHYSFS_readBytes(handle, *memblock, header->size);
offset += header->size;
valid += 1;
continue;
fail:
header->valid = false;
}
PHYSFS_close(handle);
if (valid == 0)
{
return false;
}
printf("The complete reloaded file size: %lli\n", size);
for (i = 0; i < SDL_arraysize(blob->m_headers); ++i)