mirror of
https://github.com/raysan5/raylib.git
synced 2026-04-09 16:59:09 -04:00
Check if locs is not null before try to access (#5622)
This commit is contained in:
2
src/external/rlsw.h
vendored
2
src/external/rlsw.h
vendored
@ -3446,7 +3446,7 @@ static inline bool sw_is_texture_valid(uint32_t id)
|
|||||||
else if (id >= SW_MAX_TEXTURES) valid = false;
|
else if (id >= SW_MAX_TEXTURES) valid = false;
|
||||||
else if (RLSW.loadedTextures[id].pixels == NULL) valid = false;
|
else if (RLSW.loadedTextures[id].pixels == NULL) valid = false;
|
||||||
|
|
||||||
return true;
|
return valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool sw_is_texture_filter_valid(int filter)
|
static inline bool sw_is_texture_filter_valid(int filter)
|
||||||
|
|||||||
@ -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)
|
// 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
|
// 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 (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
|
rlEnableShader(mat.shader.id); // Enable shader to set bone transform matrices
|
||||||
rlSetUniformMatrices(mat.shader.locs[SHADER_LOC_MATRIX_BONETRANSFORMS], model.boneMatrices, model.skeleton.boneCount);
|
rlSetUniformMatrices(mat.shader.locs[SHADER_LOC_MATRIX_BONETRANSFORMS], model.boneMatrices, model.skeleton.boneCount);
|
||||||
|
|||||||
Reference in New Issue
Block a user