summaryrefslogtreecommitdiff
path: root/modules/xatlas_unwrap
diff options
context:
space:
mode:
authorEv1lbl0w <ricasubtil@gmail.com>2021-03-10 18:31:44 +0000
committerEv1lbl0w <ricasubtil@gmail.com>2021-03-13 11:51:45 +0000
commit838e7d0a8d49ac5d2d149acf7afc6b909f640485 (patch)
treef11de0a5cfffb8685f017c912515c7514067333a /modules/xatlas_unwrap
parent01851defb5e43803bbcd6d8221a25ebbdd963119 (diff)
Replace malloc's with Godot's memalloc macro
Diffstat (limited to 'modules/xatlas_unwrap')
-rw-r--r--modules/xatlas_unwrap/register_types.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/xatlas_unwrap/register_types.cpp b/modules/xatlas_unwrap/register_types.cpp
index fb4df10904..e1f9521a48 100644
--- a/modules/xatlas_unwrap/register_types.cpp
+++ b/modules/xatlas_unwrap/register_types.cpp
@@ -161,8 +161,11 @@ bool xatlas_mesh_lightmap_unwrap_callback(float p_texel_size, const float *p_ver
const xatlas::Mesh &output = atlas->meshes[0];
*r_vertices = (int *)malloc(sizeof(int) * output.vertexCount);
+ ERR_FAIL_NULL_V_MSG(*r_vertices, false, "Out of memory.");
*r_uvs = (float *)malloc(sizeof(float) * output.vertexCount * 2);
+ ERR_FAIL_NULL_V_MSG(*r_uvs, false, "Out of memory.");
*r_indices = (int *)malloc(sizeof(int) * output.indexCount);
+ ERR_FAIL_NULL_V_MSG(*r_indices, false, "Out of memory.");
float max_x = 0.0;
float max_y = 0.0;