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

Commit 5ecc4435 authored by Shravya Samala's avatar Shravya Samala Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: jpeg: Ensure in/out map entries are within allowed range



Added checks to make sure in_map /out_map entries of packet
io configs are within expected maximum value.

CRs-Fixed: 3007258
Change-Id: Ia8f10f464691427d83ae7aed5cc7c90124eaa2be
Signed-off-by: default avatarShravya Samala <shravyas@codeaurora.org>
parent 47e141f5
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -721,10 +721,11 @@ static int cam_jpeg_mgr_prepare_hw_update(void *hw_mgr_priv,
	}

	if ((packet->num_cmd_buf > 5) || !packet->num_patches ||
		!packet->num_io_configs) {
		CAM_ERR(CAM_JPEG, "wrong number of cmd/patch info: %u %u",
			packet->num_cmd_buf,
			packet->num_patches);
		!packet->num_io_configs ||
		(packet->num_io_configs > CAM_JPEG_IMAGE_MAX)) {
		CAM_ERR(CAM_JPEG, "wrong number of cmd/patch info: %u %u %u",
			packet->num_cmd_buf, packet->num_patches,
			packet->num_io_configs);
		return -EINVAL;
	}