[Spice-devel] [PATHCH win-qxl 6/8] display/surface.h: make GetSurfaceId NULL safe

Hans de Goede hdegoede at redhat.com
Fri Apr 8 02:52:35 PDT 2011


Ack.

On 04/07/2011 06:10 PM, Alon Levy wrote:
> ---
>   display/surface.h |    3 +++
>   1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/display/surface.h b/display/surface.h
> index d741690..e212c46 100644
> --- a/display/surface.h
> +++ b/display/surface.h
> @@ -26,6 +26,9 @@ static _inline UINT32 GetSurfaceId(SURFOBJ *surf)
>   {
>       SurfaceInfo *surface;
>
> +    if (!surf || !surf->dhsurf) {
> +        return (UINT32)-1;
> +    }
>       surface = (SurfaceInfo *)surf->dhsurf;
>       return GetSurfaceIdFromInfo(surface);
>   }


More information about the Spice-devel mailing list