diff options
-rw-r--r-- | src/renderergl1/tr_cmds.c | 4 | ||||
-rw-r--r-- | src/renderergl2/tr_cmds.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/renderergl1/tr_cmds.c b/src/renderergl1/tr_cmds.c index 58f199e3..d92a8b94 100644 --- a/src/renderergl1/tr_cmds.c +++ b/src/renderergl1/tr_cmds.c @@ -127,8 +127,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 diff --git a/src/renderergl2/tr_cmds.c b/src/renderergl2/tr_cmds.c index fe0ee82b..5d27c52d 100644 --- a/src/renderergl2/tr_cmds.c +++ b/src/renderergl2/tr_cmds.c @@ -134,8 +134,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 |