[Spice-devel] [PATCH] display/surface: GetSurfaceId: return -1 if \!surf->dhsurf

Alon Levy alevy at redhat.com
Wed Jul 6 05:35:00 PDT 2011


Cc: Yonit Halperin <yhalperi at redhat.com>
---
 display/surface.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/display/surface.h b/display/surface.h
index 00fd93c..e677610 100644
--- a/display/surface.h
+++ b/display/surface.h
@@ -41,6 +41,9 @@ static _inline UINT32 GetSurfaceId(SURFOBJ *surf)
 {
     SurfaceInfo *surface;
 
+    if (!surf || !surf->dhsurf) {
+        return (UINT32)-1;
+    }
     surface = (SurfaceInfo *)surf->dhsurf;
     return GetSurfaceIdFromInfo(surface);
 }
-- 
1.7.5.4



More information about the Spice-devel mailing list