From dccc1068b0246697b70af2d7b6f8f7418d623324 Mon Sep 17 00:00:00 2001 From: Ladislav Zezula Date: Sun, 21 Apr 2024 18:45:43 +0200 Subject: Fixed division by zero in https://github.com/ladislav-zezula/StormLib/issues/334 --- src/FileStream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/FileStream.cpp') 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); -- cgit v1.2.3