i915: Detect allocation failure of batch buffer
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 10 Mar 2011 18:01:32 +0000 (18:01 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 29 Mar 2011 14:43:55 +0000 (15:43 +0100)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
src/mesa/drivers/dri/i915/i915_vtbl.c

index 921183b81dff7db3ef8520fe716a2036fc9aad72..942ebec29bd192e435a7edb254d88125c8de32d3 100644 (file)
@@ -307,6 +307,10 @@ i915_emit_state(struct intel_context *intel)
                                   false);
    count = 0;
  again:
+   if (intel->batch.bo == NULL) {
+      _mesa_error(ctx, GL_OUT_OF_MEMORY, "i915 emit state");
+      assert(0);
+   }
    aper_count = 0;
    dirty = get_dirty(state);