summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfritsch <fritsch@kodi.tv>2017-08-26 22:41:31 +0200
committerXiang, Haihao <haihao.xiang@intel.com>2017-09-04 13:21:58 +0800
commitec18fed72d0de6ab9787341ad999270f1bc008bc (patch)
treea9443d374c3308af7b8ac66879e8f0b53bf7af7d
parentd1617e75aeaf24feed9e83b3ad70cf983587cc6f (diff)
downloadlibva-intel-driver-ec18fed72d0de6ab9787341ad999270f1bc008bc.tar.gz
gen8_mfd: Check ptr before dereferencing
-rw-r--r--src/gen8_mfd.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gen8_mfd.c b/src/gen8_mfd.c
index c93c26df..78719b2f 100644
--- a/src/gen8_mfd.c
+++ b/src/gen8_mfd.c
@@ -1725,10 +1725,11 @@ gen8_mfd_vc1_pred_pipe_state(VADriverContextP ctx,
if (gen7_mfd_context->reference_surface[0].surface_id != VA_INVALID_ID) {
if (picture_type == 1 || picture_type == 2) { /* P/B picture */
struct gen7_vc1_surface *gen7_vc1_surface = gen7_mfd_context->reference_surface[0].obj_surface->private_data;
-
- intensitycomp_single_fwd = gen7_vc1_surface->intensity_compensation;
- luma_scale1 = gen7_vc1_surface->luma_scale;
- luma_shift1 = gen7_vc1_surface->luma_shift;
+ if (gen7_vc1_surface) {
+ intensitycomp_single_fwd = gen7_vc1_surface->intensity_compensation;
+ luma_scale1 = gen7_vc1_surface->luma_scale;
+ luma_shift1 = gen7_vc1_surface->luma_shift;
+ }
}
}