Only read co-ordinates that exist in parameter. Closes #3885

* ShaderVariable contents are not guaranteed to be 0-initialised outside of
  their valid range and could contain leftovers from older IDs and calculations.
This commit is contained in:
baldurk
2026-08-25 10:27:25 +01:00
parent 1a3e8c79bf
commit fb6f320eab
+4 -4
View File
@@ -408,8 +408,8 @@ public:
if(data.width == 0)
return rdcspv::DeviceOpResult::Failed;
uint32_t coords[4];
for(int i = 0; i < 4; i++)
uint32_t coords[4] = {};
for(int i = 0; i < coord.columns; i++)
coords[i] = uintComp(coord, i);
if(coords[0] >= data.width || coords[1] >= data.height || coords[2] >= data.depth)
@@ -551,8 +551,8 @@ public:
if(data.width == 0)
return rdcspv::DeviceOpResult::Failed;
uint32_t coords[4];
for(int i = 0; i < 4; i++)
uint32_t coords[4] = {};
for(int i = 0; i < coord.columns; i++)
coords[i] = uintComp(coord, i);
if(coords[0] >= data.width || coords[1] >= data.height || coords[2] >= data.depth)