diff options
author | Bryce Harrington <[email protected]> | 2011-01-12 10:06:12 -0800 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2011-02-11 02:33:36 +0100 |
commit | 995edd4c0a05412bb9c0f733546082cad707ecca (patch) | |
tree | ea669edb508366d7d7999627115f87156e3d8c64 /src/gallium | |
parent | 546aade28653988eedcc1d3e8fdcf35fb19da059 (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.c | 2 |
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; |