From f300c158b92452d00c08ebcd0eb08ac23d28c69e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 7 May 2014 04:18:58 +1000 Subject: Fix possible NULL pointer dereference in Cycles --- intern/cycles/render/object.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'intern/cycles/render/object.cpp') diff --git a/intern/cycles/render/object.cpp b/intern/cycles/render/object.cpp index 750fae98662..e2d6ae6fa18 100644 --- a/intern/cycles/render/object.cpp +++ b/intern/cycles/render/object.cpp @@ -189,11 +189,12 @@ vector Object::motion_times() { /* compute times at which we sample motion for this object */ vector times; - int motion_steps = mesh->motion_steps; - if(!mesh || motion_steps == 1) + if(!mesh || mesh->motion_steps == 1) return times; + int motion_steps = mesh->motion_steps; + for(int step = 0; step < motion_steps; step++) { if(step != motion_steps / 2) { float time = 2.0f * step / (motion_steps - 1) - 1.0f; -- cgit v1.2.3