(VAProcPipelineParameterBuffer *)proc_st->pipeline_param->buffer;
struct object_surface *obj_dst_surf = NULL;
struct object_surface *obj_src_surf = NULL;
+ VAStatus status;
+
proc_ctx->pipeline_param = pipeline_param;
- assert(proc_st->current_render_target != VA_INVALID_SURFACE);
if (proc_st->current_render_target == VA_INVALID_SURFACE ||
- pipeline_param->surface == VA_INVALID_SURFACE)
+ pipeline_param->surface == VA_INVALID_SURFACE) {
+ status = VA_STATUS_ERROR_INVALID_SURFACE;
goto error;
+ }
obj_dst_surf = SURFACE(proc_st->current_render_target);
- if (!obj_dst_surf)
+ if (!obj_dst_surf) {
+ status = VA_STATUS_ERROR_INVALID_SURFACE;
goto error;
+ }
obj_src_surf = SURFACE(proc_ctx->pipeline_param->surface);
- if (!obj_src_surf)
+ if (!obj_src_surf) {
+ status = VA_STATUS_ERROR_INVALID_SURFACE;
goto error;
+ }
- if (pipeline_param->num_filters && !pipeline_param->filters)
+ if (!obj_src_surf->bo) {
+ status = VA_STATUS_ERROR_INVALID_VALUE; /* The input surface is created without valid content */
goto error;
+ }
+
+ if (pipeline_param->num_filters && !pipeline_param->filters) {
+ status = VA_STATUS_ERROR_INVALID_PARAMETER;
+ goto error;
+ }
if (!obj_dst_surf->bo) {
unsigned int is_tiled = 0;
if (!obj_buf ||
!obj_buf->buffer_store ||
- !obj_buf->buffer_store->buffer)
+ !obj_buf->buffer_store->buffer) {
+ status = VA_STATUS_ERROR_INVALID_FILTER_CHAIN;
goto error;
+ }
VAProcFilterParameterBuffer* filter =
(VAProcFilterParameterBuffer*)obj_buf-> buffer_store->buffer;
filter->type == VAProcFilterColorBalance){
gen75_vpp_vebox(ctx, proc_ctx);
}else if(filter->type == VAProcFilterSharpening){
- assert(obj_src_surf->fourcc == VA_FOURCC('N','V','1','2') &&
- obj_dst_surf->fourcc == VA_FOURCC('N','V','1','2'));
-
if (obj_src_surf->fourcc != VA_FOURCC('N', 'V', '1', '2') ||
- obj_dst_surf->fourcc != VA_FOURCC('N', 'V', '1', '2'))
+ obj_dst_surf->fourcc != VA_FOURCC('N', 'V', '1', '2')) {
+ status = VA_STATUS_ERROR_UNIMPLEMENTED;
goto error;
+ }
gen75_vpp_gpe(ctx, proc_ctx);
}
for (i = 0; i < pipeline_param->num_filters; i++){
struct object_buffer * obj_buf = BUFFER(pipeline_param->filters[i]);
- assert(obj_buf && obj_buf->buffer_store && obj_buf->buffer_store->buffer);
-
if (!obj_buf ||
!obj_buf->buffer_store ||
- !obj_buf->buffer_store->buffer)
+ !obj_buf->buffer_store->buffer) {
+ status = VA_STATUS_ERROR_INVALID_FILTER_CHAIN;
goto error;
+ }
VAProcFilterParameterBuffer* filter =
(VAProcFilterParameterBuffer*)obj_buf-> buffer_store->buffer;
return VA_STATUS_SUCCESS;
error:
- return VA_STATUS_ERROR_INVALID_PARAMETER;
+ return status;
}
static void
unsigned int tiling = 0, swizzle = 0;
int in_width, in_height;
- assert(pipeline_param->surface != VA_INVALID_ID);
- assert(proc_state->current_render_target != VA_INVALID_ID);
+ if (pipeline_param->surface == VA_INVALID_ID ||
+ proc_state->current_render_target == VA_INVALID_ID) {
+ status = VA_STATUS_ERROR_INVALID_SURFACE;
+ goto error;
+ }
obj_surface = SURFACE(pipeline_param->surface);
- assert(obj_surface && obj_surface->bo);
- if (!obj_surface || !obj_surface->bo)
+ if (!obj_surface) {
+ status = VA_STATUS_ERROR_INVALID_SURFACE;
+ goto error;
+ }
+
+ if (!obj_surface->bo) {
+ status = VA_STATUS_ERROR_INVALID_VALUE; /* The input surface is created without valid content */
+ goto error;
+ }
+
+ if (pipeline_param->num_filters && !pipeline_param->filters) {
+ status = VA_STATUS_ERROR_INVALID_PARAMETER;
goto error;
+ }
in_width = obj_surface->orig_width;
in_height = obj_surface->orig_height;
VAProcFilterType filter_type;
int kernel_index;
- assert(obj_buffer && obj_buffer->buffer_store);
-
- if (!obj_buffer || !obj_buffer->buffer_store)
+ if (!obj_buffer ||
+ !obj_buffer->buffer_store ||
+ !obj_buffer->buffer_store->buffer) {
+ status = VA_STATUS_ERROR_INVALID_FILTER_CHAIN;
goto error;
+ }
out_surface_id = VA_INVALID_ID;
filter_param = (VAProcFilterParameterBufferBase *)obj_buffer->buffer_store->buffer;
proc_context->pp_context.pipeline_param = NULL;
obj_surface = SURFACE(proc_state->current_render_target);
- assert(obj_surface);
- if (!obj_surface)
+ if (!obj_surface) {
+ status = VA_STATUS_ERROR_INVALID_SURFACE;
goto error;
+ }
int csc_needed = 0;
if (obj_surface->fourcc && obj_surface->fourcc != VA_FOURCC('N','V','1','2')){
tmp_surfaces,
num_tmp_surfaces);
- return VA_STATUS_ERROR_INVALID_PARAMETER;
+ return status;
}
static void