On Fri, 2016-08-05 at 13:25 +0800, Xiang, Haihao wrote: > Remove redundant checking on input parameters as well. > > > This avoids assertion failure in https://bugs.freedesktop.org/show_bu g.cgi?id=94007, > > but the upper library should check why are the invalid paramters passed to libva.
While I agree with that sentiment, we are really not vetting much at all at the upper library level. Unfortunately, that means we may require more changes like this until we start doing more general param vetting. Separately, we've started working on some test integration plans for future experimentation. That sort of testing at the driver level will better help us to scope and define what sort of param checking we want/need at the upper driver level. Applied. Thanks, Sean > > Signed-off-by: Xiang, Haihao <[email protected]> --- src/i965_decoder_utils.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/i965_decoder_utils.c b/src/i965_decoder_utils.c index df0abe2..640fd14 100644 --- a/src/i965_decoder_utils.c +++ b/src/i965_decoder_utils.c @@ -953,17 +953,9 @@ intel_decoder_check_avc_parameter(VADriverContextP ctx, VASliceParameterBufferH264 *slice_param, *next_slice_param, *next_slice_group_param; int j; - assert(!(pic_param->CurrPic.flags & VA_PICTURE_H264_INVALID)); - assert(pic_param->CurrPic.picture_id != VA_INVALID_SURFACE); - - if (pic_param->CurrPic.flags & VA_PICTURE_H264_INVALID || - pic_param->CurrPic.picture_id == VA_INVALID_SURFACE) - goto error; - - assert(pic_param->CurrPic.picture_id == decode_state->current_render_target); - - if (pic_param->CurrPic.picture_id != decode_state->current_render_target) - goto error; + ASSERT_RET(!(pic_param->CurrPic.flags & VA_PICTURE_H264_INVALID), VA_STATUS_ERROR_INVALID_PARAMETER); + ASSERT_RET((pic_param->CurrPic.picture_id != VA_INVALID_SURFACE), VA_STATUS_ERROR_INVALID_PARAMETER); + ASSERT_RET((pic_param->CurrPic.picture_id == decode_state->current_render_target), VA_STATUS_ERROR_INVALID_PARAMETER); if ((h264_profile != VAProfileH264Baseline)) { if (pic_param->num_slice_groups_minus1 || @@ -1002,7 +994,7 @@ intel_decoder_check_avc_parameter(VADriverContextP ctx, } for (j = 0; j < decode_state->num_slice_params; j++) { - assert(decode_state->slice_params && decode_state->slice_params[j]->buffer); + ASSERT_RET((decode_state->slice_params && decode_state->slice_params[j]->buffer), VA_STATUS_ERROR_INVALID_PARAMETER); slice_param = (VASliceParameterBufferH264 *)decode_state->slice_params[j]->buffer; if (j == decode_state->num_slice_params - 1)
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Libva mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libva
