Check for truncated reads when decompressing

This commit is contained in:
baldurk
2016-10-27 12:40:19 +02:00
parent edcce279d2
commit 07c9b3697b
+2 -2
View File
@@ -180,7 +180,7 @@ struct CompressedFileIO
int32_t compSize = 0;
FileIO::fread(&compSize, sizeof(compSize), 1, m_F);
FileIO::fread(m_CompressBuf, 1, compSize, m_F);
size_t numRead = FileIO::fread(m_CompressBuf, 1, compSize, m_F);
m_CompressedSize += compSize;
@@ -191,7 +191,7 @@ struct CompressedFileIO
if(decompSize < 0)
{
RDCERR("Error decompressing: %i", decompSize);
RDCERR("Error decompressing: %i (%i / %i)", decompSize, int(numRead), compSize);
return;
}