From 4fc1a3c8b392d7819e89e0aafc1ecef558a37d4a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 1 Nov 2012 09:56:18 +0000 Subject: fix for possible buffer overflow in gpu_nodes_get_vertex_attributes() and hair_velocity_smoothing() and a unlikely NULL pointer dereference in unlink_material_cb(). --- source/blender/editors/space_outliner/outliner_tools.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/space_outliner') diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index 5fb9780c700..3b83279e09d 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -158,11 +158,16 @@ static void unlink_material_cb(bContext *UNUSED(C), Scene *UNUSED(scene), TreeEl totcol = mb->totcol; matar = mb->mat; } + else { + BLI_assert(0); + } - for (a = 0; a < totcol; a++) { - if (a == te->index && matar[a]) { - matar[a]->id.us--; - matar[a] = NULL; + if (LIKELY(matar != NULL)) { + for (a = 0; a < totcol; a++) { + if (a == te->index && matar[a]) { + matar[a]->id.us--; + matar[a] = NULL; + } } } } -- cgit v1.2.3