summaryrefslogtreecommitdiff
path: root/src/X11
diff options
context:
space:
mode:
authorAustin Yuan <shengquan.yuan@intel.com>2009-02-11 03:39:35 -0500
committerAustin Yuan <shengquan.yuan@intel.com>2009-02-11 03:39:35 -0500
commit363989ecbaf75829686218091c8d3d9703fa5e6c (patch)
treea99487d823ff00501287dc27fd9e2c530c816b57 /src/X11
parent939437e3fc617cdbc0e258d6f6ea51238341a307 (diff)
downloadlibva-363989ecbaf75829686218091c8d3d9703fa5e6c.tar.gz
Fixed the case that vaXXXX pass a corrupted vaDisplay point
Signed-off-by: Austin Yuan <shengquan.yuan@intel.com>
Diffstat (limited to 'src/X11')
-rw-r--r--src/X11/va_x11.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/X11/va_x11.c b/src/X11/va_x11.c
index 7bad12b..61ef2bf 100644
--- a/src/X11/va_x11.c
+++ b/src/X11/va_x11.c
@@ -154,6 +154,28 @@ static VAStatus va_DisplayContextGetDriverName (
return vaStatus;
}
+int vaDisplayIsValid(VADisplay dpy)
+{
+ VADisplayContextP tmp=NULL;
+ VADisplayContextP pDisplayContext = pDisplayContexts;
+
+ while (pDisplayContext)
+ {
+ if (pDisplayContext == (VADisplayContextP)dpy)
+ {
+ tmp = (VADisplay)pDisplayContext;
+ break;
+ }
+ pDisplayContext = pDisplayContext->pNext;
+ }
+
+ if (!tmp)
+ return 0;
+
+ return tmp->vaIsValid(pDisplayContext);
+}
+
+
VADisplay vaGetDisplay (
Display *native_dpy
)