diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2013-03-15 13:44:23 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2013-03-15 15:45:28 +0800 |
commit | d313f2b15a48d3da4da9191400864769d15c6eb8 (patch) | |
tree | a7bcc5c0d28d8593f69f039e06c75072929eedc0 /src/gen75_vpp_gpe.c | |
parent | 81a7227364ee23a28addb782da91e7b1edd73551 (diff) | |
download | libva-intel-driver-d313f2b15a48d3da4da9191400864769d15c6eb8.tar.gz libva-intel-driver-d313f2b15a48d3da4da9191400864769d15c6eb8.tar.bz2 libva-intel-driver-d313f2b15a48d3da4da9191400864769d15c6eb8.zip |
Check object for VA buffer
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Diffstat (limited to 'src/gen75_vpp_gpe.c')
-rw-r--r-- | src/gen75_vpp_gpe.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/gen75_vpp_gpe.c b/src/gen75_vpp_gpe.c index db6a82a..fb7eba6 100644 --- a/src/gen75_vpp_gpe.c +++ b/src/gen75_vpp_gpe.c @@ -344,9 +344,11 @@ gen75_gpe_process_sharpening(VADriverContextP ctx, VABufferID *filter_ids = (VABufferID*)pipe->filters ; struct object_buffer *obj_buf = BUFFER((*(filter_ids + 0))); - assert(obj_buf && obj_buf->buffer_store); + assert(obj_buf && obj_buf->buffer_store && obj_buf->buffer_store->buffer); - if (!obj_buf || !obj_buf->buffer_store) + if (!obj_buf || + !obj_buf->buffer_store || + !obj_buf->buffer_store->buffer) goto error; VAProcFilterParameterBuffer* filter = @@ -473,12 +475,17 @@ VAStatus gen75_gpe_process_picture(VADriverContextP ctx, unsigned int i; struct object_surface *obj_surface = NULL; + if (pipe->num_filters && !pipe->filters) + goto error; + for(i = 0; i < pipe->num_filters; i++){ struct object_buffer *obj_buf = BUFFER(pipe->filters[i]); - assert(obj_buf && obj_buf->buffer_store); + assert(obj_buf && obj_buf->buffer_store && obj_buf->buffer_store->buffer); - if (!obj_buf || !obj_buf->buffer_store) + if (!obj_buf || + !obj_buf->buffer_store || + !obj_buf->buffer_store->buffer) goto error; filter = (VAProcFilterParameterBuffer*)obj_buf-> buffer_store->buffer; @@ -515,7 +522,7 @@ VAStatus gen75_gpe_process_picture(VADriverContextP ctx, vpp_gpe_ctx->in_frame_w = obj_surface->orig_width; vpp_gpe_ctx->in_frame_h = obj_surface->orig_height; - if(filter->type == VAProcFilterSharpening) { + if(filter && filter->type == VAProcFilterSharpening) { va_status = gen75_gpe_process_sharpening(ctx, vpp_gpe_ctx); } else { va_status = VA_STATUS_ERROR_ATTR_NOT_SUPPORTED; |