Draw Manager: Fix crash when trying to order an empty shading group.
authorClément Foucault <foucault.clem@gmail.com>
Tue, 31 Oct 2017 23:57:25 +0000 (00:57 +0100)
committerClément Foucault <foucault.clem@gmail.com>
Wed, 1 Nov 2017 00:17:35 +0000 (01:17 +0100)
This fix crash when using only the volume output with an alpha blend material

source/blender/draw/intern/draw_manager.c

index 36008099b70def91cbef73172fbfd6eb45af377a..f23bbd3af45545ec6116a4e0cfe87af16ca2a84e 100644 (file)
@@ -1406,6 +1406,8 @@ static int pass_shgroup_dist_sort(void *thunk, const void *a, const void *b)
        call_b = shgrp_b->calls.first;
 #endif
 
+       if (call_a == NULL) return -1;
+       if (call_b == NULL) return -1;
 
        float tmp[3];
        sub_v3_v3v3(tmp, zsortdata->origin, call_a->obmat[3]);