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
This commit is contained in:
Jake Turner
2023-12-20 08:52:24 +00:00
parent 586ba368ce
commit 977adf5001
+1 -1
View File
@@ -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)
{