mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-13 21:40:41 +00:00
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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user