Unverified Commit 20a12b6a authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!9320 drm/amd/display: Fix potential index out of bounds in color transformation function

parents 43499e79 ee61559b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -382,6 +382,11 @@ bool cm_helper_translate_curve_to_hw_format(struct dc_context *ctx,
				i += increment) {
			if (j == hw_points - 1)
				break;
			if (i >= TRANSFER_FUNC_POINTS) {
				DC_LOG_ERROR("Index out of bounds: i=%d, TRANSFER_FUNC_POINTS=%d\n",
					     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];