Blend material: memory allocation bug

Component:YafaRay Core
Category:bug report
Assigned:David Bluecame


During some tests I found a bug in the blend material that causes some combinations of materials to generate many black/white dots (totally wrong NaN and Inf values)

I found the problem in the way the blend material allocates the pointers that point to the component materials. In some situations, the pointers are allocated the wrong way therefore getting totally wrong material results.

For example, this is an example render of a scene (with YafaRay v3.0.2-beta) that has the bug. I will attach the .blend scene in this thread for you to test as well.

Blend Material memory allocation bug.pngBlend Material memory allocation bug.png


With the bug fixed:

Blend Material memory allocation bug fixed.pngBlend Material memory allocation bug fixed.png


This bug has been extremely difficult to find, but once found it was easy to solve. In any case I will do more tests to make sure this does not cause any new issues with the blend materials. Hopefully this fix will be included in the next YafaRay version.


There are still some aspects in this render I don't like too much, but they could be unrelated to this problem and related to a different issue. I will keep investigating.






I've attached here the .blend example that causes the error stated above.


For your reference, the commit with the change that (hopefully) solves this problem is here:

AttachmentSize 94.21 KB


Status:active» ready to commit

This problem will be solved in the next YafaRay version


Status:ready to commit» fixed


This issue has been fixed in the new YafaRay v3.1.0-beta. See:


Status:fixed» closed

Fixed for more than 2 weeks without further feedback, closing.