build: fix out-of-tree builds in gallium/auxiliary
[mesa.git] / src / gallium / auxiliary / draw / draw_pipe_stipple.c
index 70fbab9ea7673dca3cbdf1a1162dd4fb0a6caaff..d97e52be09b9685ce9acd851a2bde72104ee661d 100644 (file)
@@ -73,7 +73,7 @@ screen_interp( struct draw_context *draw,
                const struct vertex_header *v1 )
 {
    uint attr;
-   int num_outputs = draw_current_shader_outputs(draw);
+   uint num_outputs = draw_current_shader_outputs(draw);
    for (attr = 0; attr < num_outputs; attr++) {
       const float *val0 = v0->data[attr];
       const float *val1 = v1->data[attr];
@@ -235,8 +235,8 @@ stipple_destroy( struct draw_stage *stage )
 struct draw_stage *draw_stipple_stage( struct draw_context *draw )
 {
    struct stipple_stage *stipple = CALLOC_STRUCT(stipple_stage);
-
-   draw_alloc_temp_verts( &stipple->stage, 2 );
+   if (stipple == NULL)
+      goto fail;
 
    stipple->stage.draw = draw;
    stipple->stage.name = "stipple";
@@ -248,5 +248,14 @@ struct draw_stage *draw_stipple_stage( struct draw_context *draw )
    stipple->stage.flush = stipple_flush;
    stipple->stage.destroy = stipple_destroy;
 
+   if (!draw_alloc_temp_verts( &stipple->stage, 2 ))
+      goto fail;
+
    return &stipple->stage;
+
+fail:
+   if (stipple)
+      stipple->stage.destroy( &stipple->stage );
+
+   return NULL;
 }