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
main
pionere 2022-02-05 12:12:21 +01:00 committed by Sylvain
parent 14db417e12
commit ce1883e1e7
No known key found for this signature in database
GPG Key ID: 5F87E02E5BC0939E
1 changed files with 3 additions and 1 deletions

View File

@ -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;