Fix tile index buf alloc size

Bug: 64893226

Change-Id: Iec02f6a7b65804cc3daadf6e29d57a7ad955d517
(cherry picked from commit 6921d875c1176cc79a582dd7416e020bf011b53e)
diff --git a/decoder/ihevcd_api.c b/decoder/ihevcd_api.c
index c349fcb..5289a12 100644
--- a/decoder/ihevcd_api.c
+++ b/decoder/ihevcd_api.c
@@ -1871,10 +1871,10 @@
     }
 
     /* Max CTBs in a row */
-    size  = wd / MIN_CTB_SIZE + 2 /* Top row and bottom row extra. This ensures accessing left,top in first row
-                                              and right in last row will not result in invalid access*/;
+    size  = wd / MIN_CTB_SIZE;
     /* Max CTBs in a column */
-    size *= ht / MIN_CTB_SIZE;
+    size *= (ht / MIN_CTB_SIZE + 2) /* Top row and bottom row extra. This ensures accessing left,top in first row
+                                              and right in last row will not result in invalid access*/;
 
     size *= sizeof(UWORD16);
     pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);