From 977adf5001ae96214a248e2e5ccf930d84fd58cf Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Wed, 20 Dec 2023 08:52:24 +0000 Subject: [PATCH] Opening DDS file better estimate size of mip-tail closes #3179 If a mip-tail exists estimate that it will be the same size as mip 0 --- renderdoc/common/dds_readwrite.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renderdoc/common/dds_readwrite.cpp b/renderdoc/common/dds_readwrite.cpp index ed89c0356..0407bc5ec 100644 --- a/renderdoc/common/dds_readwrite.cpp +++ b/renderdoc/common/dds_readwrite.cpp @@ -1222,7 +1222,7 @@ RDResult load_dds_from_file(StreamReader *reader, read_dds_data &ret) uint64_t(ret.depth) > fileSize || uint64_t(ret.slices) > fileSize || uint64_t(ret.mips) > fileSize || uint64_t(ret.slices) * ret.mips > fileSize || (uint64_t(ret.width) * uint64_t(ret.height) * uint64_t(ret.depth) * - RDCMAX(uint64_t(ret.slices), uint64_t(ret.mips))) / + RDCMAX(uint64_t(ret.slices), uint64_t(RDCMIN(2U, ret.mips)))) / 16 > fileSize) {