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

Commit 4db1ea89 authored by Clarence Ip's avatar Clarence Ip
Browse files

msm: sde: detect zero width/height in validate



Detect zero length destination width and height in rotator
validation logic to avoid divide by zero issues.

CRs-Fixed: 2040975
Change-Id: I086b0cf9f3b628d30f9506acca82dffc0cc1d92c
Signed-off-by: default avatarClarence Ip <cip@codeaurora.org>
parent cd167375
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2596,6 +2596,11 @@ static int sde_hw_rotator_validate_entry(struct sde_rot_mgr *mgr,
	}

	if ((src_w != dst_w) || (src_h != dst_h)) {
		if (!dst_w || !dst_h) {
			SDEROT_DBG("zero output width/height not support\n");
			ret = -EINVAL;
			goto dnsc_err;
		}
		if ((src_w % dst_w) || (src_h % dst_h)) {
			SDEROT_DBG("non integral scale not support\n");
			ret = -EINVAL;