diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2013-03-07 15:55:59 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2013-03-15 15:45:28 +0800 |
commit | 51947c2854a98579defe43e44a2191d21c87545d (patch) | |
tree | 22ea2d13b58ce20cfd578881c6920aee3ab6d8a3 /src/gen6_vme.c | |
parent | c006f66fae9b3d9bf2144050eb077d6c990f0282 (diff) | |
download | libva-intel-driver-51947c2854a98579defe43e44a2191d21c87545d.tar.gz libva-intel-driver-51947c2854a98579defe43e44a2191d21c87545d.tar.bz2 libva-intel-driver-51947c2854a98579defe43e44a2191d21c87545d.zip |
Avoid potential buffer overflow issue
Warning if the slice type is wrong for encoding
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Diffstat (limited to 'src/gen6_vme.c')
-rw-r--r-- | src/gen6_vme.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gen6_vme.c b/src/gen6_vme.c index 95f2d08..ec70286 100644 --- a/src/gen6_vme.c +++ b/src/gen6_vme.c @@ -444,10 +444,11 @@ static void gen6_vme_state_setup_fixup(VADriverContextP ctx, if (slice_param->slice_type != SLICE_TYPE_I && slice_param->slice_type != SLICE_TYPE_SI) return; + if (encoder_context->rate_control_mode == VA_RC_CQP) vme_state_message[16] = intra_mb_mode_cost_table[pic_param->pic_init_qp + slice_param->slice_qp_delta]; else - vme_state_message[16] = intra_mb_mode_cost_table[mfc_context->bit_rate_control_context[slice_param->slice_type].QpPrimeY]; + vme_state_message[16] = intra_mb_mode_cost_table[mfc_context->bit_rate_control_context[SLICE_TYPE_I].QpPrimeY]; } static VAStatus gen6_vme_vme_state_setup(VADriverContextP ctx, |