diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2016-08-05 13:25:58 +0800 |
---|---|---|
committer | Sean V Kelley <seanvk@posteo.de> | 2016-08-05 10:33:19 -0700 |
commit | fb7d6f56ad3000734390279a55b5c7f54ed9e3a3 (patch) | |
tree | 6b170283ed52b16bc364321429ce1c76e7c25405 | |
parent | e32ac14feacff2d1b2a082ad54c0a91e9a8735a5 (diff) |
decoder/h264: don't assert on invalid parameterHEADmasterfdo-master
Remove redundant checking on input parameters as well.
This avoids assertion failure in https://bugs.freedesktop.org/show_bug.cgi?id=94007,
but the upper library should check why are the invalid paramters passed to libva.
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Reviewed-by: Sean V Kelley <seanvk@posteo.de>
-rw-r--r-- | src/i965_decoder_utils.c | 16 |
1 files 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) |