summaryrefslogtreecommitdiff
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-01-20 12:16:33 +0800
commit2c575bac99cd4a4feb6239b246f694f0b019084e (patch)
tree261c7af356ca4b66c37a065992879ecbd1e5c346
parentdfd17c5d2b93818fc889cbe951e30ee5c28c251a (diff)
downloadlibva-intel-driver-2c575bac99cd4a4feb6239b246f694f0b019084e.tar.gz
libva-intel-driver-2c575bac99cd4a4feb6239b246f694f0b019084e.tar.bz2
libva-intel-driver-2c575bac99cd4a4feb6239b246f694f0b019084e.zip
Don't use assert() in case getting wrong parameters from user
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
-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;