And check the type before storing misc parameters
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
assert(obj_buffer->buffer_store->buffer);
param = (VAEncMiscParameterBuffer *)obj_buffer->buffer_store->buffer;
+
+ if (param->type > ARRAY_ELEMS(encode->misc_param))
+ return VA_STATUS_ERROR_INVALID_PARAMETER;
+
i965_release_buffer_store(&encode->misc_param[param->type]);
i965_reference_buffer_store(&encode->misc_param[param->type], obj_buffer->buffer_store);
int num_slice_params_ext;
int last_packed_header_type;
- struct buffer_store *misc_param[8];
+ struct buffer_store *misc_param[16];
VASurfaceID current_render_target;
struct object_surface *input_yuv_object;