File tree Expand file tree Collapse file tree 2 files changed +2
-7
lines changed Expand file tree Collapse file tree 2 files changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ winding_accu_t *AllocWindingAccu( int points ){
9494 c_peak_windings = c_active_windings ;
9595 }
9696 }
97- s = sizeof ( vec_accu_t ) * 3 * points + sizeof ( int );
97+ s = sizeof (* w ) + ( points > 4 ? sizeof ( vec3_accu_t ) * ( points - 4 ) : 0 );
9898 w = safe_malloc ( s );
9999 memset ( w , 0 , s );
100100 return w ;
Original file line number Diff line number Diff line change @@ -93,12 +93,7 @@ brush_t *AllocBrush( int numSides ){
9393 brush_t * bb ;
9494 size_t c ;
9595
96-
97- /* allocate and clear */
98- if ( numSides <= 0 ) {
99- Error ( "AllocBrush called with numsides = %d" , numSides );
100- }
101- c = (size_t )& ( ( (brush_t * ) 0 )-> sides [ numSides ] );
96+ c = sizeof (* bb ) + (numSides > 6 ? sizeof (side_t )* (numSides - 6 ) : 0 );
10297 bb = safe_malloc ( c );
10398 memset ( bb , 0 , c );
10499 if ( numthreads == 1 ) {
You can’t perform that action at this time.
0 commit comments