projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4e6a0b4
)
util: handle failed mapping in u_upload_alloc_buffer()
author
Brian Paul
<brianp@vmware.com>
Mon, 24 Oct 2011 15:37:26 +0000
(09:37 -0600)
committer
Brian Paul
<brianp@vmware.com>
Mon, 24 Oct 2011 22:39:58 +0000
(16:39 -0600)
Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/util/u_upload_mgr.c
patch
|
blob
|
history
diff --git
a/src/gallium/auxiliary/util/u_upload_mgr.c
b/src/gallium/auxiliary/util/u_upload_mgr.c
index 9bcc1bb0c6b0e38dbb27e0dbb6dfbb749d3145a3..aef4d409c2cc67b0f662deb01f5c421e1f410491 100644
(file)
--- a/
src/gallium/auxiliary/util/u_upload_mgr.c
+++ b/
src/gallium/auxiliary/util/u_upload_mgr.c
@@
-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;