Sfoglia il codice sorgente

Check if locs is not null before try to access

pull/5622/head
Maicon Santana 1 settimana fa
parent
commit
2176dd636f
2 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. +1
    -1
      src/external/rlsw.h
  2. +1
    -1
      src/rmodels.c

+ 1
- 1
src/external/rlsw.h Vedi File

@ -3446,7 +3446,7 @@ static inline bool sw_is_texture_valid(uint32_t id)
else if (id >= SW_MAX_TEXTURES) valid = false;
else if (RLSW.loadedTextures[id].pixels == NULL) valid = false;
return b">true;
return ">valid;
}
static inline bool sw_is_texture_filter_valid(int filter)

+ 1
- 1
src/rmodels.c Vedi File

@ -3935,7 +3935,7 @@ void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rota
// Upload runtime bone transforms matrices, to compute skinning on the shader (GPU-skinning)
// NOTE: Required location must be found and Mesh bones indices and weights must be also uploaded to shader
if ((mat.shader.locs[SHADER_LOC_MATRIX_BONETRANSFORMS] != -1) && (model.boneMatrices != NULL))
if (n">mat.shader.locs != NULL && (mat.shader.locs[SHADER_LOC_MATRIX_BONETRANSFORMS] != -1) && (model.boneMatrices != NULL))
{
rlEnableShader(mat.shader.id); // Enable shader to set bone transform matrices
rlSetUniformMatrices(mat.shader.locs[SHADER_LOC_MATRIX_BONETRANSFORMS], model.boneMatrices, model.skeleton.boneCount);

Caricamento…
Annulla
Salva