radeonsi/vcn: Fix out of bounds write when invalidating QP map regions

Fixes coverity issue 1559460 Out-of-bounds write

Fixes: 9c07a2e10d ("radeonsi/vcn: ROI feature implementation")

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31558>
This commit is contained in:
David Rosca
2024-10-08 10:49:50 +02:00
committed by Marge Bot
parent 17842f0584
commit 10a7356488
@@ -177,7 +177,7 @@ static void radeon_vcn_enc_get_roi_param(struct radeon_encoder *enc,
qp_map->width_in_block = width_in_block;
qp_map->height_in_block = height_in_block;
for (i = RENCODE_QP_MAP_MAX_REGIONS; i >= roi->num; i--)
for (i = RENCODE_QP_MAP_MAX_REGIONS - 1; i >= roi->num; i--)
enc->enc_pic.enc_qp_map.map[i].is_valid = false;
/* reverse the map sequence */