mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2025-02-07 14:21:01 +00:00
Fix alloc size for default skin and single shader skin
Found by Coverity.
This commit is contained in:
parent
4473924636
commit
a5fbc1bfc4
2 changed files with 4 additions and 4 deletions
|
@ -1555,7 +1555,7 @@ qhandle_t RE_RegisterSkin( const char *name ) {
|
||||||
// If not a .skin file, load as a single shader
|
// If not a .skin file, load as a single shader
|
||||||
if ( strcmp( name + strlen( name ) - 5, ".skin" ) ) {
|
if ( strcmp( name + strlen( name ) - 5, ".skin" ) ) {
|
||||||
skin->numSurfaces = 1;
|
skin->numSurfaces = 1;
|
||||||
skin->surfaces[0] = ri.Hunk_Alloc( sizeof(skin->surfaces[0]), h_low );
|
skin->surfaces[0] = ri.Hunk_Alloc( sizeof( *skin->surfaces[0] ), h_low );
|
||||||
skin->surfaces[0]->shader = R_FindShader( name, LIGHTMAP_NONE, qtrue );
|
skin->surfaces[0]->shader = R_FindShader( name, LIGHTMAP_NONE, qtrue );
|
||||||
return hSkin;
|
return hSkin;
|
||||||
}
|
}
|
||||||
|
@ -1626,7 +1626,7 @@ void R_InitSkins( void ) {
|
||||||
skin = tr.skins[0] = ri.Hunk_Alloc( sizeof( skin_t ), h_low );
|
skin = tr.skins[0] = ri.Hunk_Alloc( sizeof( skin_t ), h_low );
|
||||||
Q_strncpyz( skin->name, "<default skin>", sizeof( skin->name ) );
|
Q_strncpyz( skin->name, "<default skin>", sizeof( skin->name ) );
|
||||||
skin->numSurfaces = 1;
|
skin->numSurfaces = 1;
|
||||||
skin->surfaces[0] = ri.Hunk_Alloc( sizeof( *skin->surfaces ), h_low );
|
skin->surfaces[0] = ri.Hunk_Alloc( sizeof( *skin->surfaces[0] ), h_low );
|
||||||
skin->surfaces[0]->shader = tr.defaultShader;
|
skin->surfaces[0]->shader = tr.defaultShader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3120,7 +3120,7 @@ qhandle_t RE_RegisterSkin( const char *name ) {
|
||||||
// If not a .skin file, load as a single shader
|
// If not a .skin file, load as a single shader
|
||||||
if ( strcmp( name + strlen( name ) - 5, ".skin" ) ) {
|
if ( strcmp( name + strlen( name ) - 5, ".skin" ) ) {
|
||||||
skin->numSurfaces = 1;
|
skin->numSurfaces = 1;
|
||||||
skin->surfaces[0] = ri.Hunk_Alloc( sizeof(skin->surfaces[0]), h_low );
|
skin->surfaces[0] = ri.Hunk_Alloc( sizeof( *skin->surfaces[0] ), h_low );
|
||||||
skin->surfaces[0]->shader = R_FindShader( name, LIGHTMAP_NONE, qtrue );
|
skin->surfaces[0]->shader = R_FindShader( name, LIGHTMAP_NONE, qtrue );
|
||||||
return hSkin;
|
return hSkin;
|
||||||
}
|
}
|
||||||
|
@ -3191,7 +3191,7 @@ void R_InitSkins( void ) {
|
||||||
skin = tr.skins[0] = ri.Hunk_Alloc( sizeof( skin_t ), h_low );
|
skin = tr.skins[0] = ri.Hunk_Alloc( sizeof( skin_t ), h_low );
|
||||||
Q_strncpyz( skin->name, "<default skin>", sizeof( skin->name ) );
|
Q_strncpyz( skin->name, "<default skin>", sizeof( skin->name ) );
|
||||||
skin->numSurfaces = 1;
|
skin->numSurfaces = 1;
|
||||||
skin->surfaces[0] = ri.Hunk_Alloc( sizeof( *skin->surfaces ), h_low );
|
skin->surfaces[0] = ri.Hunk_Alloc( sizeof( *skin->surfaces[0] ), h_low );
|
||||||
skin->surfaces[0]->shader = tr.defaultShader;
|
skin->surfaces[0]->shader = tr.defaultShader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue