Browse Source

util: handle failed mapping in u_upload_alloc_buffer()

Reviewed-by: José Fonseca <jfonseca@vmware.com>
tags/mesa-8.0-rc1
Brian Paul 14 years ago
parent
commit
19961da4cb
1 changed files with 6 additions and 1 deletions
  1. 6
    1
      src/gallium/auxiliary/util/u_upload_mgr.c

+ 6
- 1
src/gallium/auxiliary/util/u_upload_mgr.c View File

@@ -141,7 +141,12 @@ u_upload_alloc_buffer( struct u_upload_mgr *upload,
PIPE_TRANSFER_WRITE |
PIPE_TRANSFER_FLUSH_EXPLICIT,
&upload->transfer);
if (upload->map == NULL) {
upload->size = 0;
pipe_resource_reference(&upload->buffer, NULL);
return PIPE_ERROR_OUT_OF_MEMORY;
}

upload->size = size;

upload->offset = 0;

Loading…
Cancel
Save