Use max of mips and slices to test for invalid dimensions

The assert was incorrectly triggering on a texture with depth of 128 and mipcount of 6
This commit is contained in:
Jake Turner
2023-08-31 13:25:57 +01:00
parent 1850ccfee1
commit df1a7cec50
+1 -1
View File
@@ -1221,7 +1221,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.depth))) /
RDCMAX(uint64_t(ret.slices), uint64_t(ret.mips))) /
16 >
fileSize)
{