st: report GL_OUT_OF_MEMORY instead of asserting
authorBrian Paul <brianp@vmware.com>
Mon, 20 Apr 2009 21:03:38 +0000 (15:03 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 21 Apr 2009 13:27:26 +0000 (07:27 -0600)
src/mesa/state_tracker/st_cb_bufferobjects.c

index ea9f73ca7b88f7ca5e5348c36898c125139787c8..a94e11fff12ba098089ee4013f14caeb1c5ed296 100644 (file)
@@ -169,10 +169,10 @@ st_bufferobj_data(GLcontext *ctx,
 
    st_obj->buffer = pipe_buffer_create( pipe->screen, 32, buffer_usage, size );
 
-   /* We don't seem to have any good way of passing failure to
-    * allocate up to Mesa??
-    */
-   assert(st_obj->buffer);
+   if (!st_obj->buffer) {
+      _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBufferDataARB");
+      return;
+   }
 
    st_obj->size = size;