svga: Prevent potential null pointer dereference in vmw_surface.c.

This commit is contained in:
Vinson Lee 2009-11-26 23:02:49 -05:00
parent 949d95e88a
commit 69671df74c

View file

@ -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;