Fix #33916: 2.65a regression: particles duplicating objects with halo - crash
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 18 Jan 2013 12:29:18 +0000 (12:29 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 18 Jan 2013 12:29:18 +0000 (12:29 +0000)
allow_render_dupli_instance used to pass zero-based index to give_current_material
which is wrong.

Before rev53332 it wasn't so much visible because give_current_material used
to clamp index internally. But that was wrong behavior here anyway, and why
nobody noticed this for so long? :)

source/blender/render/intern/source/convertblender.c

index 6c5e558e6c78a8f0038f05afb9317925c4f63933..05f5f24894462c9cd85b37839792827271f1e8cb 100644 (file)
@@ -4769,7 +4769,7 @@ static int allow_render_dupli_instance(Render *UNUSED(re), DupliObject *dob, Obj
 
        if (totmaterial) {
                for (a= 0; a<*totmaterial; a++) {
-                       ma= give_current_material(obd, a);
+                       ma= give_current_material(obd, a + 1);
                        if (ma && (ma->material_type == MA_TYPE_HALO))
                                return 0;
                }