diff options
author | Ladislav Zezula <zezula@volny.cz> | 2024-04-21 18:45:43 +0200 |
---|---|---|
committer | Ladislav Zezula <zezula@volny.cz> | 2024-04-21 18:45:43 +0200 |
commit | dccc1068b0246697b70af2d7b6f8f7418d623324 (patch) | |
tree | daf870e273cfa094e13cd976799bf7f6a6f276f0 /src/FileStream.cpp | |
parent | 355665c0ab214cae667681858cc1d8c3b0a41d4a (diff) |
Fixed division by zero in https://github.com/ladislav-zezula/StormLib/issues/334
Diffstat (limited to 'src/FileStream.cpp')
-rw-r--r-- | src/FileStream.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/FileStream.cpp b/src/FileStream.cpp index bc5618e..b66098c 100644 --- a/src/FileStream.cpp +++ b/src/FileStream.cpp @@ -1198,7 +1198,7 @@ static bool FlatStream_LoadBitmap(TBlockStream * pStream) BSWAP_ARRAY32_UNSIGNED((LPDWORD)(&Footer), sizeof(FILE_BITMAP_FOOTER));
// Verify if there is actually a footer
- if(Footer.Signature == ID_FILE_BITMAP_FOOTER && Footer.Version == 0x03)
+ if(Footer.Signature == ID_FILE_BITMAP_FOOTER && Footer.Version == 0x03 && Footer.BlockSize != 0)
{
// Get the offset of the bitmap, number of blocks and size of the bitmap
ByteOffset = MAKE_OFFSET64(Footer.MapOffsetHi, Footer.MapOffsetLo);
|