Skip to content

Commit

Permalink
gen6_mfd: Check ptr before dereferencing
Browse files Browse the repository at this point in the history
  • Loading branch information
fritsch authored and xhaihao committed Sep 4, 2017
1 parent a621318 commit a6039cb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/gen6_mfd.c
Expand Up @@ -1619,10 +1619,11 @@ gen6_mfd_vc1_pred_pipe_state(VADriverContextP ctx,
if (gen6_mfd_context->reference_surface[0].surface_id != VA_INVALID_ID) {
if (picture_type == 1 || picture_type == 2) { /* P/B picture */
struct gen6_vc1_surface *gen6_vc1_surface = gen6_mfd_context->reference_surface[0].obj_surface->private_data;

intensitycomp_single_fwd = gen6_vc1_surface->intensity_compensation;
luma_scale1 = gen6_vc1_surface->luma_scale;
luma_shift1 = gen6_vc1_surface->luma_shift;
if (gen6_vc1_surface) {
intensitycomp_single_fwd = gen6_vc1_surface->intensity_compensation;
luma_scale1 = gen6_vc1_surface->luma_scale;
luma_shift1 = gen6_vc1_surface->luma_shift;
}
}
}

Expand Down

0 comments on commit a6039cb

Please sign in to comment.