diff options
Diffstat (limited to 'va/x11/va_x11.c')
-rw-r--r-- | va/x11/va_x11.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/va/x11/va_x11.c b/va/x11/va_x11.c index 491f7c3..ab6bf68 100644 --- a/va/x11/va_x11.c +++ b/va/x11/va_x11.c @@ -216,6 +216,15 @@ VADisplay vaGetDisplay ( return dpy; } +#define CTX(dpy) (((VADisplayContextP)dpy)->pDriverContext) +#define CHECK_DISPLAY(dpy) if( !vaDisplayIsValid(dpy) ) { return VA_STATUS_ERROR_INVALID_DISPLAY; } + +static int vaDisplayIsValid(VADisplay dpy) +{ + VADisplayContextP pDisplayContext = (VADisplayContextP)dpy; + return pDisplayContext && (pDisplayContext->vadpy_magic == VA_DISPLAY_MAGIC) && pDisplayContext->vaIsValid(pDisplayContext); +} + VAStatus vaPutSurface ( VADisplay dpy, VASurfaceID surface, @@ -234,6 +243,7 @@ VAStatus vaPutSurface ( ) { VADriverContextP ctx; + CHECK_DISPLAY(dpy); ctx = CTX(dpy); |