浏览代码

null pointer check to protect segfault

some animation data has meshes without bone influence, this would segfault.
pull/4627/head
Jett 4 个月前
父节点
当前提交
dc202e8aef
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. +2
    -0
      src/rmodels.c

+ 2
- 0
src/rmodels.c 查看文件

@ -2350,6 +2350,8 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame)
bool updated = false; // Flag to check when anim vertex information is updated
const int vValues = mesh.vertexCount*3;
if ((mesh.boneWeights==NULL) || (mesh.boneIds==NULL)) continue; // skip if missing bone data, causes segfault without on some models
for (int vCounter = 0; vCounter < vValues; vCounter += 3)
{
mesh.animVertices[vCounter] = 0;

||||||
x
 
000:0
正在加载...
取消
保存