Con_Printf(CON_ERROR "Mod_LoadModel: model \"%s\" is of unknown/unsupported type\n", mod->name);
}
else if (crash)
- // LadyHavoc: Sys_Abort was *ANNOYING*
+ // LadyHavoc: Sys_Error was *ANNOYING*
Con_Printf (CON_ERROR "Mod_LoadModel: %s not found\n", mod->name);
// no fatal errors occurred, so this model is ready to use.
mod->num_surfaces = 0;
mod->surfmesh.num_vertices = 0;
mod->surfmesh.num_triangles = 0;
- memset(mod->surfmesh.data_vertexhash, -1, mod->surfmesh.num_vertexhashsize * sizeof(*mod->surfmesh.data_vertexhash));
+ if (mod->surfmesh.data_vertexhash) // UBSan: memset arg 1 isn't allowed to be null, but sometimes this is NULL.
+ memset(mod->surfmesh.data_vertexhash, -1, mod->surfmesh.num_vertexhashsize * sizeof(*mod->surfmesh.data_vertexhash));
mod->DrawSky = NULL; // will be set if a texture needs it
mod->DrawAddWaterPlanes = NULL; // will be set if a texture needs it
}