In the constructor for SpectralFilm, the splatBuffer pointer is incremented by NSpectrumSamples. I think this is wrong, and it should be incremented by nBuckets instead.
When nBuckets is greater than NSpectrumSamples, then no crash, but I think you'll get incorrect behaviour as the bucketSplats arrays will be overlapping. If nBuckets is less than NSpectrumSamples, then you'll end up reading/writing off the end of the allocated memory.
In the constructor for
SpectralFilm
, thesplatBuffer
pointer is incremented byNSpectrumSamples
. I think this is wrong, and it should be incremented bynBuckets
instead.https://github.com/mmp/pbrt-v4/blob/master/src/pbrt/film.cpp#L885
When
nBuckets
is greater thanNSpectrumSamples
, then no crash, but I think you'll get incorrect behaviour as thebucketSplats
arrays will be overlapping. IfnBuckets
is less thanNSpectrumSamples
, then you'll end up reading/writing off the end of the allocated memory.