Fix for crash with MD2s that only have an internal skin filename instead of something set in the defs

git-svn-id: https://svn.eduke32.com/eduke32@265 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-08-15 03:32:34 +00:00
parent ea72e474a0
commit 65450800b0

View file

@ -1030,6 +1030,21 @@ if ((head.id != 0x32504449) || (head.vers != 8)) { free(m); return(0); } //"IDP2
}
//OSD_Printf("Finished md3 conversion.\n");
{
mdskinmap_t *sk;
sk = (mdskinmap_t *)calloc(1,sizeof(mdskinmap_t));
sk->palette = 0;
sk->skinnum = 0;
sk->surfnum = 0;
sk->fn = (char *)malloc(strlen(m->basepath)+strlen(m->skinfn)+1);
strcpy(sk->fn, m->basepath);
strcat(sk->fn, m->skinfn);
m3->skinmap = sk;
}
// die MD2 ! DIE !
free(m->texid); free(m->skinfn); free(m->basepath); free(m->uv); free(m->tris); free(m->glcmds); free(m->frames); free(m);