Commit a59133d8 authored by Austin Yuan's avatar Austin Yuan

Fixed issues reported by Klockwork

Signed-off-by: default avatarAustin Yuan <shengquan.yuan@intel.com>
parent 16a51b8c
......@@ -736,6 +736,12 @@ VAStatus dummy_CreateContext(
obj_context->picture_height = picture_height;
obj_context->num_render_targets = num_render_targets;
obj_context->render_targets = (VASurfaceID *) malloc(num_render_targets * sizeof(VASurfaceID));
if (obj_context->render_targets == NULL)
{
vaStatus = VA_STATUS_ERROR_ALLOCATION_FAILED;
return vaStatus;
}
for(i = 0; i < num_render_targets; i++)
{
if (NULL == SURFACE(render_targets[i]))
......
......@@ -145,11 +145,11 @@ static VAStatus va_DisplayContextGetDriverName (
vaStatus = VA_STATUS_SUCCESS;
va_infoMessage("VA_DRIGetClientDriverName: %d.%d.%d %s (screen %d)\n",
driver_major, driver_minor, driver_patch, x_driver_name, ctx->x11_screen);
if (driver_name)
if (driver_name)
*driver_name = strdup(x_driver_name);
}
if (x_driver_name)
XFree(x_driver_name);
XFree(x_driver_name);
return vaStatus;
}
......
......@@ -143,10 +143,10 @@ static VAStatus va_openDriver(VADisplay dpy, char *driver_name)
char *driver_path = (char *) malloc( strlen(driver_dir) +
strlen(driver_name) +
strlen(DRIVER_EXTENSION) + 2 );
strcpy( driver_path, driver_dir );
strcat( driver_path, "/" );
strcat( driver_path, driver_name );
strcat( driver_path, DRIVER_EXTENSION );
strncpy( driver_path, driver_dir, strlen(driver_dir) );
strncat( driver_path, "/", strlen("/") );
strncat( driver_path, driver_name, strlen(driver_name) );
strncat( driver_path, DRIVER_EXTENSION, strlen(DRIVER_EXTENSION) );
va_infoMessage("Trying to open %s\n", driver_path);
......
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