summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorBryce Harrington <[email protected]>2011-01-12 10:06:12 -0800
committerMarek Olšák <[email protected]>2011-02-11 02:33:36 +0100
commit995edd4c0a05412bb9c0f733546082cad707ecca (patch)
treeea669edb508366d7d7999627115f87156e3d8c64 /src/gallium
parent546aade28653988eedcc1d3e8fdcf35fb19da059 (diff)
r300g: Null pointer check for buffer deref in gallium winsys
radeon_drm_bufmgr_create_buffer_from_handle() can return NULL buffers sometimes (seen when alt-tabbing in compiz). Avoid dereferencing the buffer pointer in this case. Ref.: https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/691653 Also: https://bugzilla.redhat.com/show_bug.cgi?id=660143 Signed-off-by: Bryce Harrington <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_r300.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_r300.c b/src/gallium/winsys/radeon/drm/radeon_r300.c
index 9f59b3de461..7a07280d2e1 100644
--- a/src/gallium/winsys/radeon/drm/radeon_r300.c
+++ b/src/gallium/winsys/radeon/drm/radeon_r300.c
@@ -118,7 +118,7 @@ static struct r300_winsys_buffer *radeon_r300_winsys_buffer_from_handle(struct r
if (stride)
*stride = whandle->stride;
- if (size)
+ if (size && _buf)
*size = _buf->base.size;
return (struct r300_winsys_buffer*)_buf;