diff options
-rw-r--r-- | src/va.c | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | src/va_backend.h | 2 | ||||
-rw-r--r-- | src/x11/va_x11.c | 2 |
3 files changed, 5 insertions, 1 deletions
@@ -58,7 +58,7 @@ static int va_debug_trace = 0; static int vaDisplayIsValid(VADisplay dpy) { VADisplayContextP pDisplayContext = (VADisplayContextP)dpy; - return pDisplayContext && pDisplayContext->vaIsValid(pDisplayContext); + return pDisplayContext && (pDisplayContext->vadpy_magic == 0x789abcde) && pDisplayContext->vaIsValid(pDisplayContext); } static void va_errorMessage(const char *msg, ...) diff --git a/src/va_backend.h b/src/va_backend.h index 6f858f5..e4faa79 100755..100644 --- a/src/va_backend.h +++ b/src/va_backend.h @@ -398,6 +398,8 @@ struct VADriverContext struct VADisplayContext { + int vadpy_magic; + VADisplayContextP pNext; VADriverContextP pDriverContext; diff --git a/src/x11/va_x11.c b/src/x11/va_x11.c index 5908fbe..42adb9e 100644 --- a/src/x11/va_x11.c +++ b/src/x11/va_x11.c @@ -189,6 +189,8 @@ VADisplay vaGetDisplay ( dri_state = calloc(1, sizeof(*dri_state)); if (pDisplayContext && pDriverContext && dri_state) { + pDisplayContext->vadpy_magic = 0x789abcde; + pDriverContext->x11_dpy = native_dpy; pDisplayContext->pNext = pDisplayContexts; pDisplayContext->pDriverContext = pDriverContext; |