aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLadislav Zezula <zezula@volny.cz>2024-04-21 18:45:43 +0200
committerLadislav Zezula <zezula@volny.cz>2024-04-21 18:45:43 +0200
commitdccc1068b0246697b70af2d7b6f8f7418d623324 (patch)
treedaf870e273cfa094e13cd976799bf7f6a6f276f0 /src
parent355665c0ab214cae667681858cc1d8c3b0a41d4a (diff)
Fixed division by zero in https://github.com/ladislav-zezula/StormLib/issues/334
Diffstat (limited to 'src')
-rw-r--r--src/FileStream.cpp2
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);