From 0229a7beb2de485ea611dc1731ab70c974614144 Mon Sep 17 00:00:00 2001 From: jsg Date: Fri, 11 Oct 2024 02:28:26 +0000 Subject: [PATCH] drm/amd/display: Fix index out of bounds in degamma hardware format translation From Srinivasan Shanmugam 122e3a7a8c7bcbe3aacddd6103f67f9f36bed473 in linux-6.6.y/6.6.55 b7e99058eb2e86aabd7a10761e76cae33d22b49f in mainline linux --- sys/dev/pci/drm/amd/display/dc/dcn10/dcn10_cm_common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/pci/drm/amd/display/dc/dcn10/dcn10_cm_common.c b/sys/dev/pci/drm/amd/display/dc/dcn10/dcn10_cm_common.c index c0372aa4ec8..684e30f9cf8 100644 --- a/sys/dev/pci/drm/amd/display/dc/dcn10/dcn10_cm_common.c +++ b/sys/dev/pci/drm/amd/display/dc/dcn10/dcn10_cm_common.c @@ -571,6 +571,8 @@ bool cm_helper_translate_curve_to_degamma_hw_format( i += increment) { if (j == hw_points - 1) break; + if (i >= TRANSFER_FUNC_POINTS) + return false; rgb_resulted[j].red = output_tf->tf_pts.red[i]; rgb_resulted[j].green = output_tf->tf_pts.green[i]; rgb_resulted[j].blue = output_tf->tf_pts.blue[i]; -- 2.20.1