va_x11: fix klockscan issue (details is bellow)
authorAustin Yuan <shengquan.yuan@gmail.com>
Tue, 5 Feb 2013 06:00:15 +0000 (14:00 +0800)
committerAustin Yuan <shengquan.yuan@gmail.com>
Tue, 5 Feb 2013 06:00:15 +0000 (14:00 +0800)
File:        va_x11.c
Function:    va_DisplayContextGetDriverName -> va_DRI2GetDriverName -> dri2_util.c:isDRI2Connected
Line:        154 -> 84 -> dri2_util.c:184
Code:
TRACEBACK
va_x11.c:151: driver_name is NULL
va_x11.c:154: 'driver_name' is passed to function 'va_DRI2GetDriverName'.
dri2_util.c:84: 'driver_name' is passed to function 'isDRI2Connected'.
dri2_util.c:184: 'driver_name' is explicitly dereferenced.

Signed-off-by: Austin Yuan <shengquan.yuan@gmail.com>
va/x11/va_x11.c

index 2aa579b..dfb9d07 100644 (file)
@@ -150,7 +150,9 @@ static VAStatus va_DisplayContextGetDriverName (
 
     if (driver_name)
        *driver_name = NULL;
-
+    else
+        return VA_STATUS_ERROR_UNKNOWN;
+    
     vaStatus = va_DRI2GetDriverName(pDisplayContext, driver_name);
     if (vaStatus != VA_STATUS_SUCCESS)
         vaStatus = va_DRIGetDriverName(pDisplayContext, driver_name);