Commit f9a0999561 for aom
commit f9a09995618828dba5a3f154f30d60779e4acd33
Author: Yunqing Wang <yunqingwang@google.com>
Date: Fri Sep 18 16:50:07 2026 -0700
Fix pixel_gradient_info allocation
In very rare cases, the work thread data needs to be re-allocated, but
the condition in is_gradient_caching_for_hog_enabled() is not true.
Thus, this results in no pixel_gradient_info data allocated for work
threads and the memory write violation happens. This change fixes this
issue.
Bug: b/559019046
Change-Id: I38b2285aeffe1732239cb2401b61a3654f386896
diff --git a/av1/encoder/ethread.c b/av1/encoder/ethread.c
index 262a671298..581294c01c 100644
--- a/av1/encoder/ethread.c
+++ b/av1/encoder/ethread.c
@@ -1037,12 +1037,10 @@ void av1_init_tile_thread_data(AV1_PRIMARY *ppi, int is_first_pass) {
}
}
- if (is_gradient_caching_for_hog_enabled(ppi->cpi)) {
- const int plane_types = PLANE_TYPES >> ppi->seq_params.monochrome;
- AOM_CHECK_MEM_ERROR(&ppi->error, td->pixel_gradient_info,
- aom_malloc(sizeof(*td->pixel_gradient_info) *
- plane_types * MAX_SB_SQUARE));
- }
+ const int plane_types = PLANE_TYPES >> ppi->seq_params.monochrome;
+ AOM_CHECK_MEM_ERROR(&ppi->error, td->pixel_gradient_info,
+ aom_malloc(sizeof(*td->pixel_gradient_info) *
+ plane_types * MAX_SB_SQUARE));
if (is_src_var_for_4x4_sub_blocks_caching_enabled(ppi->cpi)) {
const BLOCK_SIZE sb_size = ppi->cpi->common.seq_params->sb_size;