summaryrefslogtreecommitdiff
path: root/src/renderergl1
diff options
context:
space:
mode:
authorZack Middleton <zturtleman@gmail.com>2015-07-12 20:41:41 -0500
committerTim Angus <tim@ngus.net>2016-04-07 11:02:31 +0100
commit7ebcf42f808b8c1a209cabdaa6f879b8e1790036 (patch)
tree8f9601ef1f9b8749c29fa1d929b2e0e1a9296089 /src/renderergl1
parent948b565a2b0105d7c0530c78de7a4e005f73e6e8 (diff)
Fix alloc size for default skin and single shader skin
Found by Coverity.
Diffstat (limited to 'src/renderergl1')
-rw-r--r--src/renderergl1/tr_image.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/renderergl1/tr_image.c b/src/renderergl1/tr_image.c
index 6f58a5b2..e3a1f2eb 100644
--- a/src/renderergl1/tr_image.c
+++ b/src/renderergl1/tr_image.c
@@ -1556,7 +1556,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;
}
@@ -1627,7 +1627,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;
}