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]))
......
......@@ -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