mirror of
https://github.com/UberGames/ioef.git
synced 2025-01-31 13:00:46 +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 ( strcmp( name + strlen( name ) - 5, ".skin" ) ) {
|
||||
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 );
|
||||
return hSkin;
|
||||
}
|
||||
|
@ -1626,7 +1626,7 @@ void R_InitSkins( void ) {
|
|||
skin = tr.skins[0] = ri.Hunk_Alloc( sizeof( skin_t ), h_low );
|
||||
Q_strncpyz( skin->name, "<default skin>", sizeof( skin->name ) );
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -3120,7 +3120,7 @@ qhandle_t RE_RegisterSkin( const char *name ) {
|
|||
// If not a .skin file, load as a single shader
|
||||
if ( strcmp( name + strlen( name ) - 5, ".skin" ) ) {
|
||||
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 );
|
||||
return hSkin;
|
||||
}
|
||||
|
@ -3191,7 +3191,7 @@ void R_InitSkins( void ) {
|
|||
skin = tr.skins[0] = ri.Hunk_Alloc( sizeof( skin_t ), h_low );
|
||||
Q_strncpyz( skin->name, "<default skin>", sizeof( skin->name ) );
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue