diff options
author | Brian Paul <[email protected]> | 2011-10-24 09:40:07 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2011-10-24 16:39:58 -0600 |
commit | 9dc7df1feaa4f5d2f03a7490aafc6064e309f818 (patch) | |
tree | ce6fa06292fca9afafc56b8ec711d61feec49273 /src/gallium | |
parent | 19961da4cb115ca930186bef41fb92740fdd09d1 (diff) |
util: handle failed mapping in u_upload_alloc()
Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/auxiliary/util/u_upload_mgr.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_upload_mgr.c b/src/gallium/auxiliary/util/u_upload_mgr.c index aef4d409c2c..a2319d0c436 100644 --- a/src/gallium/auxiliary/util/u_upload_mgr.c +++ b/src/gallium/auxiliary/util/u_upload_mgr.c @@ -187,6 +187,11 @@ enum pipe_error u_upload_alloc( struct u_upload_mgr *upload, PIPE_TRANSFER_FLUSH_EXPLICIT | PIPE_TRANSFER_UNSYNCHRONIZED, &upload->transfer); + if (!upload->map) { + pipe_resource_reference(outbuf, NULL); + *ptr = NULL; + return PIPE_ERROR_OUT_OF_MEMORY; + } } assert(offset < upload->buffer->width0); |