summaryrefslogtreecommitdiff
path: root/src/gen8_mfd.c
diff options
context:
space:
mode:
authorXiang, Haihao <haihao.xiang@intel.com>2014-01-20 10:59:10 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2014-02-27 10:30:55 +0800
commitfb0a92c1ed852e51f550d92d510981ac4f680d1b (patch)
tree5206819f3018d4a17f900855c76f301e73921c21 /src/gen8_mfd.c
parent06702fb609b5fc9707f72a6e15e2117653ffd849 (diff)
downloadlibva-intel-driver-fb0a92c1ed852e51f550d92d510981ac4f680d1b.tar.gz
libva-intel-driver-fb0a92c1ed852e51f550d92d510981ac4f680d1b.tar.bz2
libva-intel-driver-fb0a92c1ed852e51f550d92d510981ac4f680d1b.zip
Don't use assert() in case getting wrong parameters from user
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Diffstat (limited to 'src/gen8_mfd.c')
-rw-r--r--src/gen8_mfd.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gen8_mfd.c b/src/gen8_mfd.c
index cd10187..a801a7c 100644
--- a/src/gen8_mfd.c
+++ b/src/gen8_mfd.c
@@ -3033,12 +3033,18 @@ gen8_mfd_vp8_decode_picture(VADriverContextP ctx,
pic_param = (VAPictureParameterBufferVP8 *)decode_state->pic_param->buffer;
/* one slice per frame */
- assert(decode_state->num_slice_params == 1);
- assert(decode_state->slice_params[0]->num_elements == 1);
- assert(decode_state->slice_params && decode_state->slice_params[0]->buffer);
- assert(decode_state->slice_datas[0]->bo);
+ if (decode_state->num_slice_params != 1 ||
+ (!decode_state->slice_params ||
+ !decode_state->slice_params[0] ||
+ (decode_state->slice_params[0]->num_elements != 1 || decode_state->slice_params[0]->buffer == NULL)) ||
+ (!decode_state->slice_datas ||
+ !decode_state->slice_datas[0] ||
+ !decode_state->slice_datas[0]->bo) ||
+ !decode_state->probability_data) {
+ WARN_ONCE("Wrong parameters for VP8 decoding\n");
- assert(decode_state->probability_data);
+ return;
+ }
slice_param = (VASliceParameterBufferVP8 *)decode_state->slice_params[0]->buffer;
slice_data_bo = decode_state->slice_datas[0]->bo;