]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix a crash with mdl skingroups
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 14 May 2005 06:35:54 +0000 (06:35 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 14 May 2005 06:35:54 +0000 (06:35 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5299 d7cf8633-e32d-0410-b094-e92efae38249

model_alias.c

index ec9b64510c2d5828b76dc8aef90bd1d685c1a30f..c6b8492ae88fbfe88b723037c81e62e3244186dc 100644 (file)
@@ -628,10 +628,9 @@ void Mod_IDP0_Load(model_t *mod, void *buffer)
 
        // load the skins
        skinfiles = Mod_LoadSkinFiles();
-       totalskins = loadmodel->numskins;
        loadmodel->skinscenes = Mem_Alloc(loadmodel->mempool, loadmodel->numskins * sizeof(animscene_t));
        loadmodel->num_textures = loadmodel->num_surfaces;
-       loadmodel->data_textures = Mem_Alloc(loadmodel->mempool, loadmodel->num_surfaces * loadmodel->numskins * sizeof(texture_t));
+       loadmodel->data_textures = Mem_Alloc(loadmodel->mempool, loadmodel->num_surfaces * totalskins * sizeof(texture_t));
        if (skinfiles)
        {
                Mod_BuildAliasSkinsFromSkinFiles(loadmodel->data_textures, skinfiles, "default", "");