Skip to content

Commit

Permalink
Replace 4 with sizeof( int ) in R_GetCommandBufferReserved
Browse files Browse the repository at this point in the history
  • Loading branch information
zturtleman committed Oct 18, 2015
1 parent 81e2b6c commit 41f83ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions code/renderergl1/tr_cmds.c
Expand Up @@ -126,8 +126,8 @@ void *R_GetCommandBufferReserved( int bytes, int reservedBytes ) {
bytes = PAD(bytes, sizeof(void *));

// always leave room for the end of list command
if ( cmdList->used + bytes + 4 + reservedBytes > MAX_RENDER_COMMANDS ) {
if ( bytes > MAX_RENDER_COMMANDS - 4 ) {
if ( cmdList->used + bytes + sizeof( int ) + reservedBytes > MAX_RENDER_COMMANDS ) {
if ( bytes > MAX_RENDER_COMMANDS - sizeof( int ) ) {
ri.Error( ERR_FATAL, "R_GetCommandBuffer: bad size %i", bytes );
}
// if we run out of room, just start dropping commands
Expand Down
4 changes: 2 additions & 2 deletions code/renderergl2/tr_cmds.c
Expand Up @@ -133,8 +133,8 @@ void *R_GetCommandBufferReserved( int bytes, int reservedBytes ) {
bytes = PAD(bytes, sizeof(void *));

// always leave room for the end of list command
if ( cmdList->used + bytes + 4 + reservedBytes > MAX_RENDER_COMMANDS ) {
if ( bytes > MAX_RENDER_COMMANDS - 4 ) {
if ( cmdList->used + bytes + sizeof( int ) + reservedBytes > MAX_RENDER_COMMANDS ) {
if ( bytes > MAX_RENDER_COMMANDS - sizeof( int ) ) {
ri.Error( ERR_FATAL, "R_GetCommandBuffer: bad size %i", bytes );
}
// if we run out of room, just start dropping commands
Expand Down

0 comments on commit 41f83ac

Please sign in to comment.