diff options
author | Keith Whitwell <[email protected]> | 2008-04-21 17:03:37 +0100 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2008-04-21 17:03:37 +0100 |
commit | 0d4ece4c5a243dc4b684331bad49f220311e5520 (patch) | |
tree | 8678f1241e5b47a6603da13b25a5844c92b8986c /src/gallium/auxiliary/draw/draw_pipe_clip.c | |
parent | 0cd90a917d289363a3edb5cfa40c391eb07aa97c (diff) |
draw: propogate lots of errors
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pipe_clip.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_pipe_clip.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_clip.c b/src/gallium/auxiliary/draw/draw_pipe_clip.c index 6780f275d96..21216addeab 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_clip.c +++ b/src/gallium/auxiliary/draw/draw_pipe_clip.c @@ -493,8 +493,11 @@ static void clip_destroy( struct draw_stage *stage ) struct draw_stage *draw_clip_stage( struct draw_context *draw ) { struct clipper *clipper = CALLOC_STRUCT(clipper); + if (clipper == NULL) + goto fail; - draw_alloc_temp_verts( &clipper->stage, MAX_CLIPPED_VERTICES+1 ); + if (!draw_alloc_temp_verts( &clipper->stage, MAX_CLIPPED_VERTICES+1 )) + goto fail; clipper->stage.draw = draw; clipper->stage.point = clip_point; @@ -507,4 +510,10 @@ struct draw_stage *draw_clip_stage( struct draw_context *draw ) clipper->plane = draw->plane; return &clipper->stage; + + fail: + if (clipper) + clipper->stage.destroy( &clipper->stage ); + + return NULL; } |