From ce1883e1e755f020dea34c7cbe56fcd7531382b5 Mon Sep 17 00:00:00 2001 From: pionere Date: Sat, 5 Feb 2022 12:12:21 +0100 Subject: [PATCH] fix compile error with disabled SDL_HAVE_YUV (vita) - UpdateTextureYUV is not defined if SDL_HAVE_YUV is not defined/zero + calling SDL_free suffice if the VITA_GXM_RenderData was just allocated --- src/render/vitagxm/SDL_render_vita_gxm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/render/vitagxm/SDL_render_vita_gxm.c b/src/render/vitagxm/SDL_render_vita_gxm.c index 937701298..8a8877849 100644 --- a/src/render/vitagxm/SDL_render_vita_gxm.c +++ b/src/render/vitagxm/SDL_render_vita_gxm.c @@ -217,7 +217,7 @@ VITA_GXM_CreateRenderer(SDL_Window *window, Uint32 flags) data = (VITA_GXM_RenderData *) SDL_calloc(1, sizeof(VITA_GXM_RenderData)); if (!data) { - VITA_GXM_DestroyRenderer(renderer); + SDL_free(renderer); SDL_OutOfMemory(); return NULL; } @@ -226,7 +226,9 @@ VITA_GXM_CreateRenderer(SDL_Window *window, Uint32 flags) renderer->SupportsBlendMode = VITA_GXM_SupportsBlendMode; renderer->CreateTexture = VITA_GXM_CreateTexture; renderer->UpdateTexture = VITA_GXM_UpdateTexture; +#if SDL_HAVE_YUV renderer->UpdateTextureYUV = VITA_GXM_UpdateTextureYUV; +#endif renderer->LockTexture = VITA_GXM_LockTexture; renderer->UnlockTexture = VITA_GXM_UnlockTexture; renderer->SetTextureScaleMode = VITA_GXM_SetTextureScaleMode;