File U_vaapi_Fix-off-by-one-in-ROI-regions.patch of Package intel-vaapi-driver

From 881e67a49b14631cb24a3880a28af9e5e5bacb96 Mon Sep 17 00:00:00 2001
From: Mark Thompson <sw@jkqxz.net>
Date: Mon, 4 Mar 2019 23:52:28 +0000
Subject: [PATCH] Fix off-by-one in use of ROI regions in CQP mode

Signed-off-by: Mark Thompson <sw@jkqxz.net>
---
 src/gen6_mfc_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gen6_mfc_common.c b/src/gen6_mfc_common.c
index d192eeeb..34c4a368 100644
--- a/src/gen6_mfc_common.c
+++ b/src/gen6_mfc_common.c
@@ -2126,7 +2126,7 @@ intel_h264_enc_roi_config(VADriverContextP ctx,
         memset(vme_context->qp_per_mb, qp, width_in_mbs * height_in_mbs);
 
 
-        for (j = num_roi; j ; j--) {
+        for (j = num_roi - 1; j >= 0; j--) {
             int qp_delta, qp_clip;
 
             col_start = encoder_context->brc.roi[j].left;