Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed NULL pointer dereference.
  • Loading branch information
icculus committed Dec 21, 2008
1 parent 66a2d46 commit f264e95
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mojoshader_assembler.c
Expand Up @@ -1712,8 +1712,11 @@ static uint32 add_ctab_bytes(Context *ctx, const uint8 *bytes, const size_t len)
void *ptr = Malloc(ctx, ctx->ctab_allocation);
if (ptr == NULL)
return 0;
memcpy(ptr, ctx->ctab, ctx->ctab_len);
Free(ctx, ctx->ctab);
if (ctx->ctab != NULL)
{
memcpy(ptr, ctx->ctab, ctx->ctab_len);
Free(ctx, ctx->ctab);
} // if
ctx->ctab = (uint8 *) ptr;
} // if

Expand Down

0 comments on commit f264e95

Please sign in to comment.