summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/drm
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2009-11-26 23:02:49 -0500
committerVinson Lee <[email protected]>2009-11-26 23:03:53 -0500
commit69671df74c8b45f08149c248a7ee905912aec2b0 (patch)
tree71c909b22a1e641964ca1884b66472072a4735da /src/gallium/winsys/drm
parent949d95e88a18e5047a6a7ceb1e28a8d80a30fb17 (diff)
svga: Prevent potential null pointer dereference in vmw_surface.c.
Diffstat (limited to 'src/gallium/winsys/drm')
-rw-r--r--src/gallium/winsys/drm/vmware/core/vmw_surface.c8
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;