temp-sculpt-colors: fix out of bounds error
This commit is contained in:
parent
65ef507b8b
commit
923547add3
|
@ -73,8 +73,6 @@ static void extract_vcol_init(const MeshRenderData *mr,
|
|||
AttributeDomain domain = step ? ATTR_DOMAIN_CORNER : ATTR_DOMAIN_POINT;
|
||||
|
||||
for (int j = 0; j < count; j++) {
|
||||
int idx = CustomData_get_layer_index_n(cdata, type, j);
|
||||
|
||||
char attr_name[32], attr_safe_name[GPU_MAX_SAFE_ATTR_NAME];
|
||||
const char *layer_name = CustomData_get_layer_name(cdata, type, j);
|
||||
GPU_vertformat_safe_attr_name(layer_name, attr_safe_name, GPU_MAX_SAFE_ATTR_NAME);
|
||||
|
|
|
@ -254,7 +254,7 @@ void SCULPT_vertex_color_set(SculptSession *ss, int index, float color[4])
|
|||
MLoopCol *col = ss->mcol + li;
|
||||
|
||||
linearrgb_to_srgb_v3_v3(temp, color);
|
||||
temp[4] = color[4];
|
||||
temp[3] = color[3];
|
||||
|
||||
rgba_float_to_uchar((char *)col, temp);
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ void SCULPT_vertex_color_set(SculptSession *ss, int index, float color[4])
|
|||
float temp[4];
|
||||
|
||||
linearrgb_to_srgb_v3_v3(temp, color);
|
||||
temp[4] = color[4];
|
||||
temp[3] = color[3];
|
||||
|
||||
rgba_float_to_uchar((char *)col, temp);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue