1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-04-13 11:40:38 +02:00

- fixed crash on loading last file from video archive

This commit is contained in:
Ivan Savenko 2012-08-22 10:31:20 +00:00
parent ae42abc212
commit c1726be22c

View File

@ -115,17 +115,17 @@ void CLodArchiveLoader::initVIDArchive(CFileInputStream & fileStream)
entry.name = vidEntry.filename;
entry.offset = SDL_SwapLE32(vidEntry.offset);
entry.size = 0;
// There is no size, so check where the next file is
if (i == totalFiles - 1)
{
entry.size = fileStream.getSize() - entry.offset;
entry.realSize = fileStream.getSize() - entry.offset;
}
else
{
VideoEntryBlock nextVidEntry = vidEntries[i + 1];
entry.realSize = SDL_SwapLE32(nextVidEntry.offset) - entry.offset;
entry.size = 0;
}
entries[entry.name] = entry;