OSDN Git Service

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)
committerXiang, Haihao <haihao.xiang@intel.com>
Wed, 19 Jun 2013 07:00:43 +0000 (15: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>
(cherry picked from commit c87699f32c6c79905a2fd8675cd19f22e1f4b024)

va/x11/va_x11.c

index 44c3330..c0dc69a 100644 (file)
@@ -136,7 +136,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_NVCTRL_GetDriverName(pDisplayContext, driver_name);