Commit 69d0b6e3c626a5cd8787c7b3a0dbd83112e8a296

Ivan Epifanov 2022-03-25T15:18:39

Vita: Fix NULL-pointer dereference

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/src/render/vitagxm/SDL_render_vita_gxm.c b/src/render/vitagxm/SDL_render_vita_gxm.c
index 4d55304..0dac8ea 100644
--- a/src/render/vitagxm/SDL_render_vita_gxm.c
+++ b/src/render/vitagxm/SDL_render_vita_gxm.c
@@ -756,7 +756,6 @@ VITA_GXM_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Textu
         float scale_x, float scale_y)
 {
     VITA_GXM_RenderData *data = (VITA_GXM_RenderData *) renderer->driverdata;
-    VITA_GXM_TextureData* vita_texture = (VITA_GXM_TextureData*) texture->driverdata;
     int i;
     int count = indices ? num_indices : num_vertices;
 
@@ -764,6 +763,7 @@ VITA_GXM_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Textu
     size_indices = indices ? size_indices : 0;
 
     if (texture) {
+        VITA_GXM_TextureData* vita_texture = (VITA_GXM_TextureData*) texture->driverdata;
         texture_vertex *vertices;
 
         vertices = (texture_vertex *)pool_malloc(