From 50efd72a8e3224293c1d54fe10fa07d6198fc58e Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 21 Aug 2020 10:03:32 +0200 Subject: [PATCH] gfx_display_draw_texture_slice - don't use malloc/free --- gfx/gfx_display.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/gfx/gfx_display.c b/gfx/gfx_display.c index f20a2e6166..a7149d528a 100644 --- a/gfx/gfx_display.c +++ b/gfx/gfx_display.c @@ -1054,9 +1054,9 @@ void gfx_display_draw_texture_slice( /* need space for the coordinates of two triangles in a strip, * so 8 vertices */ - float *tex_coord = (float*)malloc(8 * sizeof(float)); - float *vert_coord = (float*)malloc(8 * sizeof(float)); - float *colors = (float*)malloc(16 * sizeof(float)); + float tex_coord[8]; + float vert_coord[8]; + float colors[16]; /* normalized width/height of the amount to offset from the corners, * for both the vertex and texture coordinates */ @@ -1326,10 +1326,6 @@ void gfx_display_draw_texture_slice( gfx_display_draw(&draw, userdata, video_width, video_height); - - free(colors); - free(vert_coord); - free(tex_coord); } void gfx_display_rotate_z(gfx_display_ctx_rotate_draw_t *draw, void *data)