mirror of
https://github.com/mmp/pbrt-v4
synced 2026-09-26 16:20:07 +03:00
Merge pull request #294 from shadeops/DiffuseAreaLight_nullptr_fix
Fix nullptr access reported in issue #293
This commit is contained in:
commit
d4f5a4a43f
1 changed files with 2 additions and 6 deletions
|
|
@ -916,13 +916,9 @@ DiffuseAreaLight *DiffuseAreaLight::Create(const Transform &renderFromLight,
|
|||
// radiance such that the user-defined power will be the actual power
|
||||
// emitted by the light.
|
||||
Float k_e = 1;
|
||||
// Get the appropriate luminance vector from the image colour space
|
||||
RGB lum = imageColorSpace->LuminanceVector();
|
||||
// we need to know which channels correspond to R, G and B
|
||||
// we know that the channelDesc is valid as we would have exited in the
|
||||
// block above otherwise
|
||||
ImageChannelDesc channelDesc = image.GetChannelDesc({"R", "G", "B"});
|
||||
if (image) {
|
||||
// Get the appropriate luminance vector from the image colour space
|
||||
RGB lum = imageColorSpace->LuminanceVector();
|
||||
k_e = 0;
|
||||
// Assume no distortion in the mapping, FWIW...
|
||||
for (int y = 0; y < image.Resolution().y; ++y)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue