diff options
author | Vinson Lee <[email protected]> | 2009-11-26 23:02:49 -0500 |
---|---|---|
committer | Vinson Lee <[email protected]> | 2009-11-26 23:03:53 -0500 |
commit | 69671df74c8b45f08149c248a7ee905912aec2b0 (patch) | |
tree | 71c909b22a1e641964ca1884b66472072a4735da /src | |
parent | 949d95e88a18e5047a6a7ceb1e28a8d80a30fb17 (diff) |
svga: Prevent potential null pointer dereference in vmw_surface.c.
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/winsys/drm/vmware/core/vmw_surface.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/winsys/drm/vmware/core/vmw_surface.c b/src/gallium/winsys/drm/vmware/core/vmw_surface.c index c19e556df9f..64eb32f8b94 100644 --- a/src/gallium/winsys/drm/vmware/core/vmw_surface.c +++ b/src/gallium/winsys/drm/vmware/core/vmw_surface.c @@ -37,11 +37,13 @@ vmw_svga_winsys_surface_reference(struct vmw_svga_winsys_surface **pdst, { struct pipe_reference *src_ref; struct pipe_reference *dst_ref; - struct vmw_svga_winsys_surface *dst = *pdst; - + struct vmw_svga_winsys_surface *dst; + if(pdst == NULL || *pdst == src) return; - + + dst = *pdst; + src_ref = src ? &src->refcnt : NULL; dst_ref = dst ? &dst->refcnt : NULL; |