Improve error handling in find_center()
This commit is contained in:
parent
f57dda9094
commit
1b97f290cf
@ -59,7 +59,12 @@ HE_vert *find_center(HE_obj const * const obj)
|
|||||||
y = 0,
|
y = 0,
|
||||||
z = 0;
|
z = 0;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
HE_vert *newvert = malloc(sizeof(HE_vert));
|
HE_vert *newvert;
|
||||||
|
|
||||||
|
if (!obj)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
newvert = malloc(sizeof(HE_vert));
|
||||||
|
|
||||||
for (i = 0; i < obj->vc; i++) {
|
for (i = 0; i < obj->vc; i++) {
|
||||||
x += obj->vertices[i].x;
|
x += obj->vertices[i].x;
|
||||||
|
Loading…
Reference in New Issue
Block a user