diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-01-09 18:28:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-01-09 18:28:43 +0300 |
commit | 99a835d48258cb0106044ceb8de87d5c4ec16cd4 (patch) | |
tree | 3c5471911532282085508050c029d40a62f23577 | |
parent | 00b8c9e7eaef445be425f06111c91a92edf4406b (diff) |
warning from clang, possible crash:
'cd' could be NULL, all other particle draw types checked 'cd' except for PART_DRAW_AXIS, seems logical to have the check here too.
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 17e8b09ad68..8b77ff9bbdc 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -3326,13 +3326,15 @@ static void draw_particle(ParticleKey *state, int draw_as, short draw, float pix vec[1]=vec[2]=0.0; mul_qt_v3(state->rot,vec); if(draw_as==PART_DRAW_AXIS) { - cd[1]=cd[2]=cd[4]=cd[5]=0.0; - cd[0]=cd[3]=1.0; - cd[6]=cd[8]=cd[9]=cd[11]=0.0; - cd[7]=cd[10]=1.0; - cd[13]=cd[12]=cd[15]=cd[16]=0.0; - cd[14]=cd[17]=1.0; - pdd->cd+=18; + if(cd) { + cd[1]=cd[2]=cd[4]=cd[5]=0.0; + cd[0]=cd[3]=1.0; + cd[6]=cd[8]=cd[9]=cd[11]=0.0; + cd[7]=cd[10]=1.0; + cd[13]=cd[12]=cd[15]=cd[16]=0.0; + cd[14]=cd[17]=1.0; + pdd->cd+=18; + } copy_v3_v3(vec2,state->co); } |