mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-21 01:41:10 +00:00
Fix crash in classic GL
GL sometimes crashes when building skins. This probably isn't the correct fix (finding the situation where fb->tex can become NULL despite fb being non-null is), but it does kill the segfault. Luckily, this is git and this commit can just be reverted when the real fix shows up. :)
This commit is contained in:
parent
396338a543
commit
890c83ff6e
1 changed files with 3 additions and 2 deletions
|
@ -185,6 +185,7 @@ build_skin (skin_t *skin, int cmap)
|
|||
s = &player_skin;
|
||||
if (!s->tex) // we haven't loaded the player model yet
|
||||
return;
|
||||
|
||||
texnum = skin_textures + cmap;
|
||||
fb_texnum = 0;
|
||||
if (s->fb)
|
||||
|
@ -196,13 +197,13 @@ build_skin (skin_t *skin, int cmap)
|
|||
if (vid.is8bit) {
|
||||
build_skin_8 (s->tex, texnum, skin_cmap[cmap],
|
||||
scaled_width, scaled_height, false);
|
||||
if (s->fb)
|
||||
if (s->fb && s->fb_tex)
|
||||
build_skin_8 (s->fb_tex, fb_texnum, skin_cmap[cmap],
|
||||
scaled_width, scaled_height, true);
|
||||
} else {
|
||||
build_skin_32 (s->tex, texnum, skin_cmap[cmap],
|
||||
scaled_width, scaled_height, false);
|
||||
if (s->fb)
|
||||
if (s->fb && s->fb_tex)
|
||||
build_skin_32 (s->fb_tex, fb_texnum, skin_cmap[cmap],
|
||||
scaled_width, scaled_height, true);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue