From 353089d3bed58c0d54530295b0f200232bd32611 Mon Sep 17 00:00:00 2001 From: Darshana Patil Date: Tue, 30 Jul 2019 17:07:24 -0700 Subject: [PATCH] msm: venc: fix ltrmode for unsupported codec/RC type Do a get control before accessing the control value to make sure right structure is accessed. Change-Id: Iabf2ca85c342fe46d2236232794bbe9b9981fb18 Signed-off-by: Darshana Patil --- msm/vidc/msm_venc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/msm/vidc/msm_venc.c b/msm/vidc/msm_venc.c index f66fe9e60de4..3d70c18b8e71 100644 --- a/msm/vidc/msm_venc.c +++ b/msm/vidc/msm_venc.c @@ -3741,6 +3741,7 @@ int msm_venc_set_ltr_mode(struct msm_vidc_inst *inst) return -EINVAL; } hdev = inst->core->device; + ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VIDEO_LTRCOUNT); codec = get_v4l2_codec(inst); if (!(codec == V4L2_PIX_FMT_HEVC || codec == V4L2_PIX_FMT_H264)) { @@ -3755,7 +3756,6 @@ int msm_venc_set_ltr_mode(struct msm_vidc_inst *inst) goto disable_ltr; } - ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VIDEO_LTRCOUNT); if (!ctrl->val) return 0; if (ctrl->val > inst->capability.cap[CAP_LTR_COUNT].max) {