From 45c140b03d0c8868caf4ca3d6e13802fd78c32d5 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Sun, 17 Mar 2024 22:19:15 +0700 Subject: [PATCH] Fix buffer size. --- src/GLideNHQ/TxUtil.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GLideNHQ/TxUtil.cpp b/src/GLideNHQ/TxUtil.cpp index c03f20923..57a132fda 100644 --- a/src/GLideNHQ/TxUtil.cpp +++ b/src/GLideNHQ/TxUtil.cpp @@ -517,7 +517,7 @@ TxUtil::StrongCRC32(const uint8* src, int width, int height, int size, int rowSt const uint32 bytesPerLine = width << size >> 1; u64 crc = UINT64_MAX; - std::vector buf(height*rowStride); + std::vector buf(static_cast(height) * std::max(bytesPerLine, static_cast(rowStride))); uint8* pData = buf.data(); try { for (int y = 0; y < height; ++y) {