Skip to content

Commit 0a8f052

Browse files
committed
Fixed the access to an uninitialized variable when using PhotonGI caustic cache alone
1 parent 50fc4cc commit 0a8f052

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

release-notes.txt

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
* Fixed a problem with caustic cache size when both PhotonGI caches were
7272
enabled and automatic stop condition for indirect cache was used
7373
* PhotonGI Metropolis will now focus on caustic cache when indirect is done (and vice versa)
74+
* Fixed the access to an uninitialized variable when using PhotonGI caustic cache alone
7475

7576
Check https://wiki.luxcorerender.org/LuxCoreRender_Release_Notes for the full list
7677
of release notes.

src/slg/engines/caches/photongi/photongicache.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ bool PhotonGICache::IsPhotonGIEnabled(const BSDF &bsdf) const {
6262
const BSDFEvent eventTypes = bsdf.GetEventTypes();
6363

6464
if ((eventTypes & TRANSMIT) || (eventTypes & SPECULAR) ||
65-
((eventTypes & GLOSSY) && (bsdf.GetGlossiness() < params.indirect.glossinessUsageThreshold)))
65+
// Note: params.indirect.glossinessUsageThreshold is not initialized
66+
// if indirect cache is not enabled
67+
((eventTypes & GLOSSY) && (params.indirect.enabled) &&
68+
(bsdf.GetGlossiness() < params.indirect.glossinessUsageThreshold)))
6669
return false;
6770
else
6871
return bsdf.IsPhotonGIEnabled();

tests/valgrind.suppress

+8
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,14 @@
148148
...
149149
}
150150

151+
{
152+
libamdocl-orca64_cond1
153+
Memcheck:Cond
154+
...
155+
obj:*/libamdocl-orca64.so
156+
...
157+
}
158+
151159
################################################################################
152160
# AMD fglrx
153161
################################################################################

0 commit comments

Comments
 (0)