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: Austin Zheng <austin.zheng@amd.com> Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Tom Chung <chiahsuan.chung@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -600,8 +600,8 @@ static void CalculateBytePerPixelAndBlockSizes(
|
||||
{
|
||||
*BytePerPixelDETY = 0;
|
||||
*BytePerPixelDETC = 0;
|
||||
*BytePerPixelY = 0;
|
||||
*BytePerPixelC = 0;
|
||||
*BytePerPixelY = 1;
|
||||
*BytePerPixelC = 1;
|
||||
|
||||
if (SourcePixelFormat == dml2_444_64) {
|
||||
*BytePerPixelDETY = 8;
|
||||
|
||||
Reference in New Issue
Block a user