Commit 36b23e3b authored by Alex Hung's avatar Alex Hung Committed by Alex Deucher
Browse files

drm/amd/display: Initialize denominator defaults to 1



[WHAT & HOW]
Variables, used as denominators and maybe not assigned to other values,
should be initialized to non-zero to avoid DIVIDE_BY_ZERO, as reported
by Coverity.

Reviewed-by: default avatarAustin Zheng <austin.zheng@amd.com>
Reviewed-by: default avatarRodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: default avatarAlex Hung <alex.hung@amd.com>
Signed-off-by: default avatarTom Chung <chiahsuan.chung@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
(cherry picked from commit e2c4c6c1)
parent b5c764d6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -579,8 +579,8 @@ static void CalculateBytePerPixelAndBlockSizes(
{
	*BytePerPixelDETY = 0;
	*BytePerPixelDETC = 0;
	*BytePerPixelY = 0;
	*BytePerPixelC = 0;
	*BytePerPixelY = 1;
	*BytePerPixelC = 1;
	if (SourcePixelFormat == dml2_444_64) {
		*BytePerPixelDETY = 8;