aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-11-09 16:58:33 +0100
committermarha <marha@users.sourceforge.net>2011-11-09 16:58:33 +0100
commita8e5f06fe01732fbd643bc435dd3b8eaa602defe (patch)
treeb18cd9881bc5a6d317edca6c38fa912bade00802 /mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c
parent1ed503a856d9753a813951796bc6ba56c42ecd28 (diff)
downloadvcxsrv-a8e5f06fe01732fbd643bc435dd3b8eaa602defe.tar.gz
vcxsrv-a8e5f06fe01732fbd643bc435dd3b8eaa602defe.tar.bz2
vcxsrv-a8e5f06fe01732fbd643bc435dd3b8eaa602defe.zip
libX11 mesa pixman git update 9 nov 2011
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c b/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c
index aab7444e2..adac92f2c 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c
@@ -115,6 +115,11 @@ st_bufferobj_subdata(struct gl_context *ctx,
if (!data)
return;
+ if (!st_obj->buffer) {
+ /* we probably ran out of memory during buffer allocation */
+ return;
+ }
+
/* Now that transfers are per-context, we don't have to figure out
* flushing here. Usually drivers won't need to flush in this case
* even if the buffer is currently referenced by hardware - they
@@ -146,6 +151,11 @@ st_bufferobj_get_subdata(struct gl_context *ctx,
if (!size)
return;
+ if (!st_obj->buffer) {
+ /* we probably ran out of memory during buffer allocation */
+ return;
+ }
+
pipe_buffer_read(st_context(ctx)->pipe, st_obj->buffer,
offset, size, data);
}
@@ -216,6 +226,8 @@ st_bufferobj_data(struct gl_context *ctx,
pipe_usage, size);
if (!st_obj->buffer) {
+ /* out of memory */
+ st_obj->Base.Size = 0;
return GL_FALSE;
}