Skip to content

Commit

Permalink
Handle out of memory error better.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Feb 3, 2009
1 parent d79ddb2 commit 7a19260
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mojoshader_assembler.c
Expand Up @@ -1779,10 +1779,12 @@ static MOJOSHADER_error *build_errors(Context *ctx)

static const MOJOSHADER_parseData *build_failed_assembly(Context *ctx)
{
MOJOSHADER_parseData *retval = NULL;
if (!isfail(ctx))
return NULL;
assert(isfail(ctx));

if (ctx->out_of_memory)
return &out_of_mem_data;

MOJOSHADER_parseData *retval = NULL;
retval = (MOJOSHADER_parseData*) Malloc(ctx, sizeof(MOJOSHADER_parseData));
if (retval == NULL)
return &out_of_mem_data;
Expand Down

0 comments on commit 7a19260

Please sign in to comment.