瀏覽代碼

Check if locs is not null before try to access (#5622)

pull/5624/head
Maicon Santana 1 周之前
committed by GitHub
父節點
當前提交
2eaac95df0
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: B5690EEEBB952194
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. +1
    -1
      src/external/rlsw.h
  2. +1
    -1
      src/rmodels.c

+ 1
- 1
src/external/rlsw.h 查看文件

@ -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 查看文件

@ -3928,7 +3928,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);

Loading…
取消
儲存