summaryrefslogtreecommitdiff
path: root/src/renderergl2
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/renderergl2
parent948b565a2b0105d7c0530c78de7a4e005f73e6e8 (diff)
Fix alloc size for default skin and single shader skin
Found by Coverity.
Diffstat (limited to 'src/renderergl2')
-rw-r--r--src/renderergl2/tr_image.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/renderergl2/tr_image.c b/src/renderergl2/tr_image.c
index 08894a4a..ef244d56 100644
--- a/src/renderergl2/tr_image.c
+++ b/src/renderergl2/tr_image.c
@@ -3121,7 +3121,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;
}
@@ -3192,7 +3192,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;
}