shithub: libvpx

Download patch

ref: 9bbbda038765c80bf04b99b33a3779010d560673
parent: a7ccc91e3a4e0d1f706407e54bd90b728bd59cf7
author: Ritu Baldwa <ritu.baldwa@ittiam.com>
date: Fri Feb 1 08:37:07 EST 2019

Fix segmentation fault when num tile cols change in row-mt.

Change-Id: Ifc165d76a71fcdb7c19c158c940a8d273be0d95f

--- a/vp9/decoder/vp9_decodeframe.c
+++ b/vp9/decoder/vp9_decodeframe.c
@@ -2768,6 +2768,7 @@
     int num_sbs = 1;
     const int aligned_rows = mi_cols_aligned_to_sb(cm->mi_rows);
     const int sb_rows = aligned_rows >> MI_BLOCK_SIZE_LOG2;
+    const int num_jobs = sb_rows << cm->log2_tile_cols;
 
     if (pbi->row_mt_worker_data == NULL) {
       CHECK_MEM_ERROR(cm, pbi->row_mt_worker_data,
@@ -2784,10 +2785,11 @@
       num_sbs = sb_cols * sb_rows;
     }
 
-    if (num_sbs > pbi->row_mt_worker_data->num_sbs) {
+    if (num_sbs > pbi->row_mt_worker_data->num_sbs ||
+        num_jobs > pbi->row_mt_worker_data->num_jobs) {
       vp9_dec_free_row_mt_mem(pbi->row_mt_worker_data);
       vp9_dec_alloc_row_mt_mem(pbi->row_mt_worker_data, cm, num_sbs,
-                               pbi->max_threads, sb_rows << cm->log2_tile_cols);
+                               pbi->max_threads, num_jobs);
     }
     vp9_jobq_alloc(pbi);
   }