Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 05f2237d authored by Qiwei Liu's avatar Qiwei Liu Committed by Gerrit - the friendly Code Review server
Browse files

techpack: video: fix integer overflow issue for blur resolution



Use S32_MAX instead of U32_MAX for maximum ctrl val for
blur resolution, as ctrl val is s32.

Change-Id: Ie92f6ba831ffead2d56c9eee24917b8a42cdd564
Signed-off-by: default avatarQiwei Liu <qiweil@codeaurora.org>
parent 70e7d6b0
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -792,7 +792,7 @@ static struct msm_vidc_ctrl msm_venc_ctrls[] = {
		.name = "Set Blur width/height",
		.type = V4L2_CTRL_TYPE_INTEGER,
		.minimum = 0,
		.maximum = 0xFFFFFFFF,
		.maximum = S32_MAX,
		.default_value = 0,
		.step = 1,
	},
@@ -3788,7 +3788,9 @@ int msm_venc_set_blur_resolution(struct msm_vidc_inst *inst)

	frame_sz.buffer_type = HFI_BUFFER_INPUT;
	frame_sz.height = ctrl->val & 0xFFFF;
	frame_sz.width = (ctrl->val & 0xFFFF0000) >> 16;
	frame_sz.width = (ctrl->val & 0x7FFF0000) >> 16;
	dprintk(VIDC_DBG, "%s: type %u, height %u, width %u\n", __func__,
		frame_sz.buffer_type, frame_sz.height, frame_sz.width);
	rc = call_hfi_op(hdev, session_set_property, inst->session,
		HFI_PROPERTY_CONFIG_VENC_BLUR_FRAME_SIZE, &frame_sz,
		sizeof(frame_sz));