Skip to content

Commit

Permalink
Check for buffer overflow for rail/lightning surfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
zturtleman committed Jan 26, 2014
1 parent dde36d9 commit cc9072d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions code/renderergl1/tr_surface.c
Expand Up @@ -344,6 +344,8 @@ static void DoRailCore( const vec3_t start, const vec3_t end, const vec3_t up, f
int vbase;
float t = len / 256.0f;

RB_CHECKOVERFLOW( 4, 6 );

vbase = tess.numVertexes;

spanWidth2 = -spanWidth;
Expand Down
2 changes: 2 additions & 0 deletions code/renderergl2/tr_surface.c
Expand Up @@ -627,6 +627,8 @@ static void DoRailCore( const vec3_t start, const vec3_t end, const vec3_t up, f
int vbase;
float t = len / 256.0f;

RB_CHECKOVERFLOW( 4, 6 );

vbase = tess.numVertexes;

spanWidth2 = -spanWidth;
Expand Down

0 comments on commit cc9072d

Please sign in to comment.