Fix off-by-one in dlist allocation when checking whether to allocate a new block. This fixes segfaults in dlist functions that occur on applications making heavy use of display lists that exceed BLOCK_SIZE.
This commit is contained in:
parent
921461fcd8
commit
5cf6ab0cf4
1 changed files with 1 additions and 1 deletions
|
@ -1220,7 +1220,7 @@ dlist_alloc(struct gl_context *ctx, OpCode opcode, GLuint bytes, bool align8)
|
|||
ctx->ListState.CurrentPos++;
|
||||
}
|
||||
|
||||
if (ctx->ListState.CurrentPos + numNodes + contNodes > BLOCK_SIZE) {
|
||||
if (ctx->ListState.CurrentPos + numNodes + contNodes >= BLOCK_SIZE) {
|
||||
/* This block is full. Allocate a new block and chain to it */
|
||||
Node *newblock;
|
||||
Node *n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue