[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34199] trunk/blender/source/blender/ editors/space_view3d/drawobject.c: warning from clang, possible crash:

Campbell Barton ideasman42 at gmail.com
Sun Jan 9 16:28:44 CET 2011


Revision: 34199
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=34199
Author:   campbellbarton
Date:     2011-01-09 15:28:43 +0000 (Sun, 09 Jan 2011)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_view3d/drawobject.c

Modified: trunk/blender/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawobject.c	2011-01-09 15:12:08 UTC (rev 34198)
+++ trunk/blender/source/blender/editors/space_view3d/drawobject.c	2011-01-09 15:28:43 UTC (rev 34199)
@@ -3326,13 +3326,15 @@
 			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);
 			}




More information about the Bf-blender-cvs mailing list