X Tutup
Skip to content

Commit 2eaac95

Browse files
Check if locs is not null before try to access (#5622)
1 parent de720a8 commit 2eaac95

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/external/rlsw.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3446,7 +3446,7 @@ static inline bool sw_is_texture_valid(uint32_t id)
34463446
else if (id >= SW_MAX_TEXTURES) valid = false;
34473447
else if (RLSW.loadedTextures[id].pixels == NULL) valid = false;
34483448

3449-
return true;
3449+
return valid;
34503450
}
34513451

34523452
static inline bool sw_is_texture_filter_valid(int filter)

src/rmodels.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3928,7 +3928,7 @@ void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rota
39283928

39293929
// Upload runtime bone transforms matrices, to compute skinning on the shader (GPU-skinning)
39303930
// NOTE: Required location must be found and Mesh bones indices and weights must be also uploaded to shader
3931-
if ((mat.shader.locs[SHADER_LOC_MATRIX_BONETRANSFORMS] != -1) && (model.boneMatrices != NULL))
3931+
if (mat.shader.locs != NULL && (mat.shader.locs[SHADER_LOC_MATRIX_BONETRANSFORMS] != -1) && (model.boneMatrices != NULL))
39323932
{
39333933
rlEnableShader(mat.shader.id); // Enable shader to set bone transform matrices
39343934
rlSetUniformMatrices(mat.shader.locs[SHADER_LOC_MATRIX_BONETRANSFORMS], model.boneMatrices, model.skeleton.boneCount);

0 commit comments

Comments
 (0)
X Tutup