From f97fb90d90afe68f1a34056648f366d73a34b2c4 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 13 May 2022 19:38:46 +0900 Subject: [PATCH] [model] Fix alias skin group loading Although the skin pointer was being advanced after recording the information in for the batch array, it was being reset the next time around the loop (due to a mistranslation of the previous code). This fixes the segfault while loading (gl, glsl, vulkan) or rendering (sw) the sphere model from Rogue. --- libs/models/alias/model_alias.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libs/models/alias/model_alias.c b/libs/models/alias/model_alias.c index 4e1832bd2..a080fc0e9 100644 --- a/libs/models/alias/model_alias.c +++ b/libs/models/alias/model_alias.c @@ -113,7 +113,6 @@ Mod_LoadAllSkins (mod_alias_ctx_t *alias_ctx, int numskins, for (gnum = 0; gnum < groupskins; gnum++) { paliasskingroup->skindescs[gnum].type = ALIAS_SKIN_SINGLE; - skin = (byte *) (pskintype + 1); mod_alias_skin_t askin = { .skin_num = snum, .group_num = gnum, @@ -263,7 +262,7 @@ Mod_LoadAliasModel (model_t *mod, void *buffer, cache_allocator_t allocator) mod->name, version, ALIAS_VERSION_MDL); // allocate space for a working header, plus all the data except the - // frames, skin and group info + // frame data, skin and group info size = field_offset (aliashdr_t, frames[LittleLong (pinmodel->numframes)]); header = Hunk_AllocName (0, size, mod->name); memset (header, 0, size);