Skip to content

[examples] models_animation_blending: avoid crash when animations fail to load - #6234

Merged
raysan5 merged 1 commit into
raysan5:masterfrom
akashdeshmukh-git:fix-anim-blending-no-anims
Oct 8, 2026
Merged

raysan5 merged 1 commit into
raysan5:masterfrom
akashdeshmukh-git:fix-anim-blending-no-anims

Conversation

@akashdeshmukh-git

Copy link
Copy Markdown
Contributor

Follow-up to my comment in #5664 about the models_animation_blending crash (animCount = 0, anims = 0x0).

When resources/models/gltf/robot.glb can't be found (for example running from another working directory), LoadModelAnimations() returns NULL and the example indexes anims[] in the update loop and in the timeline drawing. This skips both when animCount == 0, so it just logs the usual load warnings.

Tested with PLATFORM_MEMORY + software renderer under ASan/UBSan: runs normally with the resources, and no longer crashes without them

…l to load

If resources/models/gltf/robot.glb can't be found (e.g. the example is
run from another working directory), LoadModelAnimations() returns NULL
with animCount = 0 and the example indexed anims[] in the update loop
and in the timeline drawing, crashing. Skip both when no animations
were loaded, so it just logs the usual load warnings.

Reported in raysan5#5664.
@raysan5
raysan5 merged commit a043255 into raysan5:master Oct 8, 2026
@raysan5

raysan5 commented Oct 8, 2026

Copy link
Copy Markdown
Owner

@akashdeshmukh-git thanks for the improvement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants