ref: 844ca16ab1db927e0b5aff2f41b364673514da5c
parent: 50a93e8539756adff830da8911078ae8931414f9
parent: 9bbbda038765c80bf04b99b33a3779010d560673
author: Harish Mahendrakar <harish.mahendrakar@ittiam.com>
date: Fri Feb 1 23:01:57 EST 2019
Merge "Fix segmentation fault when num tile cols change in row-mt."
--- 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);
}