Commit 363989ec authored by Austin Yuan's avatar Austin Yuan

Fixed the case that vaXXXX pass a corrupted vaDisplay point

Signed-off-by: default avatarAustin Yuan <shengquan.yuan@intel.com>
parent 939437e3
...@@ -154,6 +154,28 @@ static VAStatus va_DisplayContextGetDriverName ( ...@@ -154,6 +154,28 @@ static VAStatus va_DisplayContextGetDriverName (
return vaStatus; 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 ( VADisplay vaGetDisplay (
Display *native_dpy Display *native_dpy
) )
......
...@@ -51,11 +51,7 @@ ...@@ -51,11 +51,7 @@
static int va_debug_trace = 0; static int va_debug_trace = 0;
static int vaDisplayIsValid(VADisplay dpy) int vaDisplayIsValid(VADisplay dpy);
{
VADisplayContextP pDisplayContext = (VADisplayContextP)dpy;
return pDisplayContext && pDisplayContext->vaIsValid(pDisplayContext);
}
static void va_errorMessage(const char *msg, ...) static void va_errorMessage(const char *msg, ...)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment